MySQL Forums
Forum List  »  Newbie

Grouping by hour, day, weekday, week, month and year
Posted by: Kashif Butt
Date: September 17, 2011 07:29AM


I would like to group data according to hour, day, weekday, week, month and year based on one date column. My other problem is that I want to calculate data from 4am the first day till 3.59am the last day!

For example, the query for a week should be retrieve data from Monday 4am till the next Monday 3.59am. Same goes for month and year.

Many thanks

Options: ReplyQuote

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.