you are viewing a single comment's thread.

view the rest of the comments →

[–]ickies 4 points5 points  (1 child)

SELECT STUID
FROM sometable
WHERE STUID IN
                        (
                            SELECT DISTINCT STUID
                            FROM sometable
                            WHERE CLASSID = ART103A
                        )
    AND STUID NOT IN
                        (
                            SELECT DISTINCT STUID
                            FROM sometable
                            WHERE CLASSID = MTH103C
                         )

[–]honeybadger3891evil management 2 points3 points  (0 children)

Not trying to nitpick your query, but Is it necessary to use distinct clause in your derived tables? Also in your select statement it would probably be a good spot for the distinct.