Results 1 to 3 of 3

Thread: Need help with query

  1. #1
    Join Date
    Dec 2009
    Posts
    1

    Need help with query

    I want to retrieve total number of web activities for each hour interval.

    I am hoping to get this output

    Today

    hour(EST) Number of Web Activities
    12am-1am
    1am-2m
    ....
    11pm -12pm

    How to I write the query

  2. #2
    Join Date
    Feb 2011
    Posts
    7
    select count(*) from tablename where date_time>='' or date_time<=''

  3. #3
    Join Date
    Feb 2011
    Posts
    6

    Count by hour

    You can do this like so:

    select hour(date_time) as hour, count(*) from test where date(date_time) = date(now()) group by hour(date_time);

    Bert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •