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

  • 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