开发者

Mysql Ordering by date

开发者 https://www.devze.com 2023-02-06 21:54 出处:网络
I have a date field in my table called date1开发者_如何学Python. if i use the following query. select * from schedule order by date1 asc

I have a date field in my table called date1开发者_如何学Python. if i use the following query.

 select * from schedule order by date1 asc

 it gives the result like as jan 2011 comes before december 2010. but i need the december 2011 as the first row of the result. 


Change your query to

SELECT * FROM schedule ORDER BY date1 DESC

This should do the trick.

James


select * from schedule order by date1 desc
0

精彩评论

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