Jump to content

mysql group by the particular day?


ohdang888

Recommended Posts

I have this query:

 

SELECT COUNT(impression_id) AS total FROM impressions WHERE widget_id='$widget_id' GROUP BY YEAR(datetime), MONTH(datetime), DAY(datetime)

 

What i am trying to do is get a COUNT of impression from each individual 24 hour day. so.. for this table i have 2 dates right now (they are in datetime format) lets say 2010-05-06 and 2010-05-07... i want the count for each day...

 

right now... all its returning in total = 1 ... but i have 2 dates with about 5 impressions each in them

Link to comment
https://forums.phpfreaks.com/topic/204335-mysql-group-by-the-particular-day/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.