Donate

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

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input