Latest Post

Error: No input file specified.

While trying to run a codeigniter app the other day I came across this error just after I had finished uploading the files and making the ne...

Monday, May 25, 2009

How to group by a datetime field in mysql

SELECT YEAR(datefield) Y, MONTH(datefield) M, DAY(datefield) D FROM yourtable
GROUP BY DAY(datefield)

No comments:

Post a Comment

Chitika Ads