PDA

View Full Version : How to ORDER BY DESC properly. It makes 150 before 50 if ASC order!?



kaisellgren
07-28-2006, 05:40 PM
Hi,

I have this list:
50
150
200
250
300
350
400
450
500

If I order it by ASC order then mysql results this:
150
200
250
300
350
400
450
50
500

What the hell ?? How do I order it properly??

Thanks

Kid Charming
07-28-2006, 05:59 PM
What type is your column?

guelphdad
07-28-2006, 07:01 PM
It is either VARCHAR or CHAR type.

If you are storing numeric data then choose the correct column type. Switch it to INT and it will sort fine.