Ephialtes Posted September 23, 2005 Share Posted September 23, 2005 Basically, how come when i do an ordinary order by, using ORDER BY permission DESC and i have 10 entries, it goes like so: 9 8 7 6 5 4 3 2 1 10 How can i get it to put the 10 on the top? Is MySQL just stupid about counting? Quote Link to comment https://forums.phpfreaks.com/topic/2556-mysql-order-by/ Share on other sites More sharing options...
perchance Posted September 23, 2005 Share Posted September 23, 2005 put a 0 in front of your numbers: 10 09 08 07 06 05 04 03 02 01 Quote Link to comment https://forums.phpfreaks.com/topic/2556-mysql-order-by/#findComment-8485 Share on other sites More sharing options...
Ephialtes Posted September 23, 2005 Author Share Posted September 23, 2005 Firstly, sorry for posting in the wrong area, i keep doing it by mistake, and secondly, that would muck up my system. Is there no other way of doing it? Quote Link to comment https://forums.phpfreaks.com/topic/2556-mysql-order-by/#findComment-8488 Share on other sites More sharing options...
kenrbnsn Posted September 23, 2005 Share Posted September 23, 2005 How is your field defined? If is it a character string, that how numbers are sorted when they are treated as text. Define it as an int and it should sort fine. Ken Quote Link to comment https://forums.phpfreaks.com/topic/2556-mysql-order-by/#findComment-8489 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.