tags:

views:

34

answers:

1

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?

+2  A: 

ORDER BY CAST(passportno AS UNSIGNED)

simendsjo