SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table x ( id int, from_date date, to_date date ); insert into x values (1, '2022-06-02', '2022-06-04'), (2, '2022-06-02', '2022-06-03'), (3, '2022-06-01', '2022-06-07'), (4, '2022-06-05', '2022-06-20'); select unnest(array[ '2022-06-07', '2022-06-08', '2022-06-09' ]::date[]) d; select * from x join ( select unnest(array[ '2022-06-07', '2022-06-08', '2022-06-09' ]::date[]) d ) y on y.d between from_date and to_date;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear