• Hi John,

    I have changed the code as below. It is returning data.

    FROM

    HAVING

    COUNT(*) = (SELECT COUNT(*) FROM TblData)

    TO

    HAVING

    COUNT(*) > 0

    Am I doing correct?

    Regards,

    P.Paul

    John Mitchell-245523 (8/22/2013)


    Here you go. Obviously it doesn't return any rows for your sample data, but if it did, you could join back to A if you need the student name.

    John

    SELECT

    B.StudentID

    FROM

    B

    JOIN

    TblData d ON B.ClassID = d.ClassID AND B.SectionID = d.SectionID

    GROUP BY

    b.StudentID

    HAVING

    COUNT(*) = (SELECT COUNT(*) FROM TblData)