Those back-ticks suggest you are using mySQL? This is a Microsoft SQL conference so folk here may not be familiar with MySQL.I would expect you to need to specify the Column name in your second example (rather than "SELECT *"), and you need to SUM the Counts from the inner-select - COUNT(*) [in the outer select] is only going to tell you the number or rows in the inner select:SELECT player_id, SUM(T_Count)FROM ( SELECT challenger_id AS player_id, COUNT( * ) AS T_Count FROM `games` GROUP BY `challenger_id` UNION ALL SELECT challengee_id AS player_id, COUNT( * ) AS T_Count FROM `games` GROUP BY `challengee_id` ) AS tempGROUP BY player_id