开发者

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)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜