Hello everyone,
Im trying to sort a mysql column in descending numerical order. I have that part figured out, but sometimes, I get the same number, and id like to start sorting the results that are the same by a different column.
Take a look here first:
http://www.webanvil.net/dl/standings.php
Its a ranking system for an online game that I play. Anyway, the default sorting is by score, and as you can see, there are some people with "0" as their score. At this point, Mysql just arbitrarily lists the tied scores whatever way it wants. Even though it isnt in that state right now, Ive seen the ladder sometimes put 0-3, under 0-4, which would not be right.
I would like to be able to rank the tied scores by losses, or some other category. So if 2 people both had "0" as their score, and one's record was 0-3, and one was 0-4, Id like to be able to rank those in ascending order, so that 0-3, comes before 0-4.
Anyone know how to do this? Is there a mysql query with this kind of logic?:
select * from duel order by score desc AND IF THEY ARE THE SAME, order by losses ascending?
Thanks, any help will be appreciated,
Shawn