;With cte As(Select ID, DeptId, Marks, Row_Number() Over(Partition By ID Order By Marks Desc) As rn From #Student)Select ID, DeptId, MarksFrom cteWhere rn = 1Order By ID;
No comments:
Post a Comment