如何在ASC中订购日期,
日期采用以下格式
01 January 2013
13 August 2013
27 June 2013
我试过这个查询
SELECT * FROM table ORDER BY TIMESTAMP(date) ASC
和此查询
SELECT * FROM property_rent ORDER BY UNIX_TIMESTAMP(date) ASC
答案 0 :(得分:4)
使用str_to_date功能:
SELECT * FROM table ORDER BY str_to_date(date, 'your format here')
e.g。
SELECT * FROM table ORDER BY str_to_date(date, '%d %M %Y')
或类似。