Tuesday, October 28, 2014

Select top 1 record from a table which has duplicates - Please help!


Select Id,DeptiD,Marks From (
Select Row_Number() Over (Partition By Id Order By Marks Desc) As RwNum,* FROm #Student
)Data
Where RwNum = 1

Check this



Please have look on the comment


No comments:

Post a Comment