开发者

type casting in mysql

开发者 https://www.devze.com 2023-01-03 14:45 出处:网络
i have passportno(varchar) in database. i am entering values like this 001,002,003. andi want to display like sorting order.

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)

0

精彩评论

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