(針對 SQL 語言的問題,用這個標題。請用 Ctrl+Y 砍掉這行)
資料庫名稱:
MySQL
資料庫版本:
內容/問題描述:
兩個語法是這樣的
1.
select no,name
from clerk
where not exists(
(select book_no from book where auth='lee')
except
(select book_no
from trade_detail natural join trade
where trade.no=clerk.no));
2.
select no,name from clerk
where not exists(
select * from book where auth='lee' AND NOT EXISTS (
select * from trade natural join trade_detail
where trade.no=clerk.no AND trade_detail.book_no=book.book_no));
以上兩個語法結果是相同的結果
問題是不懂not exists+except的做何種的運算方式??
跟not exists做兩次是一樣的運算
不知道有人肯幫分析一下not exists之後接except 是怎樣的執行結果??
小的難以頓悟~"~感謝幫忙!!