开发者

Order by date and time

I have two varchar fields which store the date and time in the following format: date=2010-08-18; time=07:53:55;

What would be the right sql query to show m开发者_JAVA百科e the events from the most recent to the oldest


Aside from recommending that you use MySQL datetime fields rather than VARCHARs for any date or time values; what about something simple like adding an ORDER BY clause to your query:

ORDER BY `DATE` DESC, `TIME` DESC
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜