type casting in mysql
i have passportno(varchar) in database.
i am entering values like this 001,002,003. and i want to display like sorting order.now i wrote query like this "select * from passport_registration where status=1 ORDER BY passportno"
开发者_运维知识库 then displaying output like this......077,088,099,100,1000,1001,1009,101,1010
i want to diplay sort order. how to do?
ORDER BY CAST(passportno AS UNSIGNED)
精彩评论