开发者

MySQL order by on varchar

In my table, there is a column called time.

F开发者_Go百科ield type is varchar, value is like HH:MM , 02-25 ,21-42, 07-15

How to do the ordering by desc?


select * from table_name order by column_name DESC;

where,

table_name is name of table and 
column_name is name of column in the table (independent of whatever the data-type)

Note:-for proper o/p Your datatype for the time column should be datetime


The problem was fixed by:

ORDER BY CreationDate ASC,CreationTime DESC
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜