Count Record In Every Hour Of A Given Day In (MySQL Database
Here is a query to count records gathered in every hour of a given day. The date_visited is a 24 hour time format which is of timestamp data type. The idea came from a fellow developer..
select hour(time(date_visited)) as hour_of_day_24_hour_format, count(hour(time(date_visited))) as count_per_hour from tblpropsale_v2 where date(date_visited) = '2012-05-07' and web_id = 642 and is_visited = 1 group by hour(time(date_visited)) order by hour(time(date_visited)) asc;
Comments
Post a Comment