If I have a table like this:
yr subject
1960 Physics
1960 Chemistry
1961 Physics
1962 Chemistry
I want all the years when the subject is Physics and not chemistry
If I try this , it does not give me correct result.
select yr from table where subject = "Physics" and
yr NOT IN (select yr from table where subject = "Chemistry")