MySQL Forums
Forum List  »  PHP

MySql Date Query
Posted by: Rajeev Nair
Date: April 09, 2009 12:27AM

How will I get the count of the number of docs processed every three hours ? Presently group by hour(lastupdated) gives me an hourly count. A 3 hour hour count is what i am looking for? Can somebody assist?

select hour(time(lastupdated)), count(1)
from docstable where date(LastUpdated)=date(now())
group by hour(time(lastupdated));

Options: ReplyQuote

Written By
MySql Date Query
April 09, 2009 12:27AM
April 09, 2009 10:25AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.