Reputation: 2146
I am converting my SQL database to MYSQL and I have problem using cast in mysql, please help me to convert this SQL query to mysql
Here col1 is type of varchar (storing values(01,02,03,04))
select * from table1 order by cast(col1 as numeric)
Upvotes: 0
Views: 106
Reputation: 62841
Try using the data type SIGNED
instead:
select *
from table1
order by cast(col1 as SIGNED)
Upvotes: 2