SELECT BGRP.player_id as Player, COUNT(DISTINCT(BGRP.round_id)) AS Rounds, SUM(BGRP.win) as Wins, SUM(BGRP.loose) as Looses, SUM(BGRP.bye) as Bye, SUM(BGRP.sum) as Sum, IF(SUM(BGRP.sum)> 0 ,SUM(BGRP.sum),0) as TOTAL, SUM(BGRP.gp_added) as GPSum, (SUM(BGRP.sum)+(SUM(BGRP.gp_added)*GAMES.game_amount)) as SUMPLUSGP FROM bg_r_p_sum as BGRP LEFT JOIN bg_games as GAMES on GAMES.game_id = BGRP.game_id WHERE BGRP.game_id='191' GROUP BY BGRP.player_id ORDER BY SUMPLUSGP DESC, GPSum DESC, Player DESC, Rounds DESC