Hi,
I need to write a report query for dates. Unfortunately, the group by clauses are not in the database - they are dynamic and not part of a table or anything like that.
I need to group like this: 1) today 2) yesturday 3) last 3 days 4) last 7 days 5) last 30 days 6) last 90 days
The only way I know how to do this with my non-master level sql knowledge is to write separate queries... or write some kind of a custom function to do the partitioning for me, although I have to keep in mind that this must work uniformly for hsqldb and mysql.
Any tips on where to get help for this sort of query? My guess is that this one, if it's possible, will be pretty tricky.
Thanks
|