SQL Select Top N within Group By?



SELECT ID, groupName, hitValue,
Rank() OVER (PARTITION BY groupName ORDER BY hitValueDESC) AS Rank
FROM myHits




No comments:

Post a Comment

Note: Only a member of this blog may post a comment.