Re: how to count the number of each item per day ok, i've found the answer. i've compared it against hours, as my test
case doesn't yet have enough days. but here it is, in a simplified
form:
select date_format(date, "%H"), item, count(item)
from mytable
group by item, date_format(date, "%H")
the trick is in using two fields in the `group by' clause! |