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
精彩评论