SQLize Online / PHPize Online

A A A
Share   Donate   Blog   Popular
Copy Format Clear
create table deal ( start_date date, end_date date, "sum" integer ); insert into deal values ('2010-01-01', '2011-01-01', 3), ('2010-01-01', '2010-04-01', 5), ('2011-01-01', '2012-01-01', 1); select '2010-05-01' as "date", sum("sum") from deal where '2010-05-01'::date between start_date and end_date union select '2010-02-01', sum("sum") from deal where '2010-02-01'::date between start_date and end_date
Stuck with a problem? Need help? Ask professionals on our Telegram channel!
Join the channel
Your quersion is posted.
Join our Telegram channel and get answers.
Send
Copy