R
Roger
I'm having a hard time figuring this out.
I have a table called Tgames that looks like this
Index, Game ID, Player, Points
1, 1, Player A, 10
2, 2, Player A, 5
3, 3, Player A, 10
4, 4, Player A, 7
5, 1, Player B, 5
6, 2, Player B, 7
7, 3, Player B, 5
8, 4, Player B, 10
9, 5, Player A, 5
10, 6, Player A, 7
11, 7, Player A, 5
12, 8, Player A, 5
13, 5, Player B, 10
14, 6, Player B, 7
15, 7, Player B, 7
16, 8, Player B, 7
I'm trying to get Top 3 points for each player with this query :
SELECT T.Player, T.Points
FROM Tgames As T
WHERE T.Points In (SELECT TOP 3 X.Points
FROM Tgames As X
WHERE X.[Player] = T.[Player]
ORDER BY X.Points DESC, X.Index)
ORDER BY T.Player
But I get 4 records for Player A, and 6 records for Player B...
What am I doing wrong? Please help!
Thanks!
I have a table called Tgames that looks like this
Index, Game ID, Player, Points
1, 1, Player A, 10
2, 2, Player A, 5
3, 3, Player A, 10
4, 4, Player A, 7
5, 1, Player B, 5
6, 2, Player B, 7
7, 3, Player B, 5
8, 4, Player B, 10
9, 5, Player A, 5
10, 6, Player A, 7
11, 7, Player A, 5
12, 8, Player A, 5
13, 5, Player B, 10
14, 6, Player B, 7
15, 7, Player B, 7
16, 8, Player B, 7
I'm trying to get Top 3 points for each player with this query :
SELECT T.Player, T.Points
FROM Tgames As T
WHERE T.Points In (SELECT TOP 3 X.Points
FROM Tgames As X
WHERE X.[Player] = T.[Player]
ORDER BY X.Points DESC, X.Index)
ORDER BY T.Player
But I get 4 records for Player A, and 6 records for Player B...
What am I doing wrong? Please help!
Thanks!