I am working on a rankings page for a game and am looking to order the rankings first by wins, and then by losses (in case of people having the same number of wins). The following query works fine in order to make a list in order by wins, but I am not sure how to put losses into this query.
SELECT username, COUNT(id) AS wins
FROM tblBattleHistory
WHERE battle_type = '0' && outcome = '1'
GROUP BY username
ORDER BY wins DESC
outcome = '1' means they won, so when outcome = '0' then that means they lost.