SELECT DISTINCT(player) FROM game JOIN goal ON matchid = id WHERE (team1='GER' AND team2!='GER' OR team1!='GER' AND team2='GER') AND teamid!= 'GER' It not that pretty but it works