i have a table stores activity
a want to generate a overview selecting sum(total) based on the date (unixtime)
like Select SUM(total) from list where date between 123456789 and 2000000
somethings like this ..
but i would like to get more date ranges out with one query
to have a listable result like
- sum(total) of 2 days ago
- sum(total) of yesterday
- sum(total) of today
and so on …
You don’t need a
UNION. Something like this should work: