Try this. I have assumed that ID is a candidate key and that it defines the ordering of "first user". With a question like this it helps a lot if you specify the key(s) of your table. Also, when you specify "first" you need to explain what determines the first row otherwise we have to guess. Tables have no inherent order.
SELECT TOP (3) ID, Score, [User]
FROM
(SELECT ID, Score, [User],
ROW_NUMBER() OVER (PARTITION BY Score ORDER BY ID) rn
FROM tbl) t
WHERE rn = 1
ORDER BY Score DESC ;
Main Topics
Browse All Topics





by: indianguru2Posted on 2008-09-01 at 15:07:30ID: 22363072
Select distinct top 3 ID, Score, user
from tablename
order by score desc