I have a table mytable with an event time field called evtime. To summarize the number of entries per day, I use:
select date_trunc('day',evtime),
count(1) as entries
from mytable
group by date_tunc('day',evtime);
That works fine. But now, for one specific date, I'd like to see the totals per hour.
Is this what you mean?
Or, it occurs to me that you want the summary by day on most days and by hour on one. If so: