Sunday, June 27

Group by date time in MySql

I create a field with date-time option like this

`scan_date` datetime DEFAULT NULL,


And I just know that we can grab date only partial by using date in sql statement. Try this:

SELECT avg(wqi), date(scan_date) dateOnly FROM `riverdata` group by dateOnly


:P

No comments: