Using MS SQL I’m trying the following:
I have one table with game data. In this table a player name can occur many times.
I now want to create a summary table, where every player has a single row.
Using the following statement, I can populate the summary tables “playername” column.
INSERT INTO PLAYER_Summary (Playername)
SELECT DISTINCT [Playername]
FROM ppPLAYER
The summary table also has columns for sums of the players results.
How can i populate my summary table so that each name and the correlating sums are in it once.
I need something like:
INSERT INTO PLAYER_Summary
(Playername, WinWhat )
SELECT DISTINCT [Playername] FROM ppPLAYER , SUM(WinWhat) FROM ppPLAYER
How can I make this work and parse the unique playername with his sum?
Thanks
1 Answer