sql server 2008 - Need help trying to RANK with a GROUP BY -
I am having difficulty in ranking each of my students in the house group, which they are inside.
Example counterfeit data
HomeGroup 1. Team Red 2. Team Blue 3. Team Skeet 4. Team Green Students 1. John, Score - 34, Team Red 2. Jill, Score - 87.3 Team Red 3. Fred , Score - 41, Team Green 4. Jane, Score 93, Team Blue ...
etc.
My Production Low
Score student 1, score 34, rank - 5th student rectangle 2, score 87.3, rank - 1 student id 3, score 41, rank - 9th student 4, score 94, rank-1
I'm trying to use DENSE_RANK .. And if I run against a single homegroup (for example Homegroup = 1) then it works fine ... But I'm not sure how to do this on all HomeGroup.
I'm guessing that I need an update query, which has a subquery ... and this subquery has its own subquery ... ??
I am very confused :( And I think of the evil cursor that I refuse to use until I get a gun on my head (because I believe this' set 'Notation can be handled correctly).
Obtaining dense_rank of each student in the team To:
SELECT *, DENSE_RANK () (part of the team by the team order by the score);
It is not clear to me that Do you want to update.
Comments
Post a Comment