How can I solve this little problem
here is a screenshot:

and this is the query:
SELECT *
FROM serverinfo
ORDER BY rank_pts DESC
As you can see the order is incorect.
You could try this:
ORDER BY CAST(rank_pts as float) DESC
Seems your ranl_pts column is varchar type so it's not sorting as numbers.
Use below trick.
SELECT *
FROM serverinfo
ORDER BY rank_pts+0 DESC
OR
SELECT *
FROM serverinfo
ORDER BY CAST(rank_pts AS DOUBLE) desc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With