Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

http://sqlzoo.net/wiki/SELECT_from_Nobel_Tutorial

Can someone give me some help to do the #8?
I am new to SQL, and I really have no idea why my answer is wrong:

select yr from nobel where 
yr in (select distinct yr from nobel where subject='Physics') 
and 
yr not in (select distinct yr from nobel where subject='Chemistry')

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
359 views
Welcome To Ask or Share your Answers For Others

1 Answer

All, I got it solved by myself.

select distinct yr from nobel 
where 
subject='Physics' and yr not in 
(select distinct yr from nobel where subject='Chemistry')

Thanks

I also find a way to reveal the answer of those questions(at least some of them) just append ?answer=1 to the url, you may be able to get an answer page. Hope this works!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...