Help with ORDER BY Clause

Hello MysQL Masters !

I have a script that monitors the games played in a tournament and update the pool table accordingly.

Now, have a look at this image:

Our rule of sorting is this :

  1. Most Win
  2. Minimum Lost
  3. Minimum Runs Scored
  4. Maximum Runs Scored

Now, if you can see the image again, first 2 records are GOOD as team ZEETESTING4 has won 2 games but allowed less runs as compared with ZEETESTING2.

But the last 2 records are not good.
you can see that ZEETESTING3 has allowed less runs as compared with ZEETESTING1.

So here is what I want as result :

1        ZEETESTING4
2        ZEETESTING2
3        ZEETESTING3 
4        ZEETESTING1

Here is my current ORDER BY Clause.

ORDER BY won DESC , lost, allowed ASC 

Please help and guide me how I can achieve the desired results.


You can translate your rule directly to query:

ORDER BY won DESC, lost ASC, scored ASC

Though #4 makes no sense. You already sorted by runs scored in #3.

Thanks a lot Sir ! its working

Oh I made a mistake. I am sorry for that.

The sorting rules are like this :

  1. Most Win
  2. Minimum Lost
  3. Minimum Runs Allowed
  4. Maximum Runs Scored

For some reason, the previous suggestion is no more working, therefore I checked and found that I entered incorrect rules there.

Can u still help me ?

ORDER BY win DESC, lost ASC, allowed ASC, scored DESC

Thanks a lot Sir !