score board

G

Guest

hi all, I want to make a score board. i have this table with scoreId ,
playerId and score. Not all players have same amount of scores. Some have
only 4 others have 200. I need a query that gives me the top 10 scores for
each player . I tried Select top 10 but that wasn't working. Thanks, Franky.
 
M

Michel Walsh

Hi,


SELECT a.*
FROM scores As a
WHERE a.scoreValue IN( SELECT TOP 10 b.scoreValue
FROM scores As b
WHERE a.playerID = b.playerID
ORDER BY b.scoreValue DESC)

ORDER BY a.playerID, a.scoreValue DESC



The last order by is not required, here, it is just used for "disposition" .



Franky said:
hi all, I want to make a score board. i have this table with scoreId ,
playerId and score. Not all players have same amount of scores. Some have
only 4 others have 200. I need a query that gives me the top 10 scores for
each player . I tried Select top 10 but that wasn't working. Thanks,
Franky.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Query Help Needed 7
Min not working 2
sum n scores 1
Count and Group By 3
Sum Top n Scores 4
Delete query won't delete 3
Compare records in a query then write equation?? 3
Excel Excel conundrum - I've tried and tried, but 10

Top