I have a series of values in a varchar field. I need to display them in an ordered list as:
32
51
75
80
100
Unfortunately, since it is a text field, MySQL sorts the values as:
100
32
51
75
80
Is there any way to get these to sort numerically?
I cannot add leading zeroes to the records. I cannot change the field type to an integer because other records include letters. I am using this with PHP so if it is not possible to sort in the SQL, maybe a PHP trick might do.
- - picklefish - -
32
51
75
80
100
Unfortunately, since it is a text field, MySQL sorts the values as:
100
32
51
75
80
Is there any way to get these to sort numerically?
I cannot add leading zeroes to the records. I cannot change the field type to an integer because other records include letters. I am using this with PHP so if it is not possible to sort in the SQL, maybe a PHP trick might do.
- - picklefish - -