Home Forums SQL Server 2008 T-SQL (SS2K8) List out rows from a duplicate record set that has one or more odd values RE: List out rows from a duplicate record set that has one or more odd values
Bhaskar.Shetty
Hall of Fame
Points: 3054
More actions
May 22, 2013 at 5:17 am
#1617365
Try the below query..
SELECT *
FROM @mySampleTable s
OUTER APPLY (SELECT TOP 1 FROM @mySampleTable g WHERE s.CaseID = g.CaseID
AND s.StudentId = g.StudentID ORDER BY CreatedDate DESC) h