Tuesday, 15 April 2014

MySQL Order By Column1 / Column2 -


  select player, 'kills', 'death' orders 'data' from 'DESC' range 0  

How to order (killing / death) for big value

thanks

  --- --- --------------------- | Player Kills Death | --------------------------- | User1 | 20 | 2 | --------------------------- | User2 | 10 | 2 | --------------------------- | User3 | 30 | 2 | ---------------------------  

KDR = death ratio = kill / death

then such result sequence

  1 user3 = 15 2. user1 = 10 3. user2 = 5  

Here's a solution to your problem:

  select 'player', 'kill', 'death', 'help The 'help' order (in case when 'kills' & gt; 'death' then kills 'ELSE' death) DESC limit 1, 10  

To use the code> case kills for Nne results for ordering ' or ' death '.


No comments:

Post a Comment