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

  • It can be done without using windowed function (so, will have better performance):

    SELECT *

    FROM @mySampleTable s

    WHERE s.CaseID IN (SELECT CaseID

    FROM @mySampleTable

    GROUP BY CaseID

    HAVING MAX(StudentID) != MIN(StudentID))

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]