Sorry for not including the code in the first place.
This is what i've done so far:
SELECT players.name, teams.teamName, performance.shirtNo, players.position, performance.goals FROM players, performance, teams WHERE goals = (SELECT MAX(goals) FROM performance) AND players.teamID = teams.teamID AND players.teamID = performance.teamID;
E.g:Which results in:
name - teamName - shirtNo - position - goals
Henry - Barcelona - 9 - FW - 9
This information is based on the maximum goal in the performance table. But I need to add all the goals scored by each player individualy and display the above information based on the highest goal (E.g. total goals scored by the player with the teamID=2).
I've used "COUNT()," "SUM() GROUP BY teamID" statement, I can count the number of goals scored by each player, but I can't combine the two code. (E.g Count the goals for each player, display the above infromation based on the highest goal) I've looked into JOIN, subqueries and I just couldn't figure it out.
Hope this helps.