开发者

select DISTINCT dates from mysql table

I want to select the DISTINCT dates (ignore开发者_开发百科 time) from the table; then for each date, I want to select all data for that date?


Don't execute a query for each date, rather you should do something like:

SELECT DATE(date_column), other_column FROM your_table ORDER BY DATE(date_column)

And when you are processing your result set pay attention to whether the date result has changed.

This way you only dispatch one query.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜