Created
June 4, 2013 00:51
-
-
Save andrewkowalik/5702775 to your computer and use it in GitHub Desktop.
SQLZoo SELECT from Nobel Tutorial #8 solution using single join, no sub-query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT a.yr | |
FROM nobel a | |
LEFT OUTER JOIN nobel b | |
ON a.yr=b.yr | |
AND b.subject NOT IN ('Economics','Literature','Medicine','Peace','Physics') | |
WHERE b.subject IS NULL | |
AND a.subject = 'Physics' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your query was really very good. But, how did you know the subjects without any query?
So, I think it would be better to modify your query as follows: