I write ...
ORDER BY column ASC
but my column is VARCHAR
and it sorts wrong like 1, 10, 2
, instead of 1, 2, 10
.
How can I do it to sort like 1, 2, 10
?
order by
cast(column as float)
Notes:
Edit: For MySQL. You can not cast to float
order by
cast(column as decimal(38,10))