In MySQL, let's say I have a table with a column called 'actionTime' declared as a 'datetime' (YYYY-MM-DD HH:MM:SS).
Is there an easy way to use "GROUP BY actionTime" but only use the 'date' part of the 'datetime'?
Thanks
Should be able to
GROUP BY date(actionTime)
See this for more info.
Ahh Google .. so easy to use.
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date
mysql> SELECT DATE('2003-12-31 01:02:03');
-> '2003-12-31'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With