[SQL ] 一條sql問題
找出參與五號部門所管理的的全部計畫的員工姓名
select lname fname
from employee
where not exists (select*
from works_on B
where(B.pno in (select pnumber
from project
where dnum=5)
and
not exists(select*
from works_on c
where c.Essn-Ssn
and c.pno=b.pno)))
題目在陳玄玲聖經本5-8頁 其中 c.pno=b.pno c 與 b 不是一樣的表格嗎
做這有何意義嗎 還是那個b.pno 是
B.pno in (select pnumber
from project
where dnum=5)
的b.pno
又 兩個not exists 可以同時替換成 exists 嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 36.224.113.128
※ 編輯: badbadook 來自: 36.224.113.128 (08/01 16:41)
→
08/01 20:27, , 1F
08/01 20:27, 1F
→
08/02 10:25, , 2F
08/02 10:25, 2F
→
08/02 14:00, , 3F
08/02 14:00, 3F
→
08/02 14:27, , 4F
08/02 14:27, 4F
→
08/02 14:28, , 5F
08/02 14:28, 5F
→
08/02 14:28, , 6F
08/02 14:28, 6F
→
08/02 14:28, , 7F
08/02 14:28, 7F