Creating query to aggregate game results