I have a table containing access logs. I want to know how many accesses to resource_id \'123\' occured in each hour in a 24 hour day.
My first thought for retrieving thi
You can use the function HOUR to get the hour out of the time. Then you should be able to group by that.
SELECT HOUR(MyDatetimeColumn) AS h, COUNT(*) FROM MyTable GROUP BY h;