Is there a way to group records that fall between two dates?
For example, my table has records that look like this:
rid stamp u
If there were only one group then you could use the "group by with having clause". I don't think there is syntax to specify multiple different groupings in one statement and separate them though. Here is the simplest alternative solution I can think of that will work:
select "July 2005 - January 2006" AS "Date", count(date) as "results"
from MYTABLE
where date >= '2005-07-01' AND date <= '2006-01-31'
union
select "February 2006 - August 2006" AS "Date", count(date) as "results"
from MYTABLE
where date >= '2006-02-01' AND date <= '2006-08-31';