IN子查詢與EXISTS子查詢

IN和EXISTS能夠與相關子查詢一塊兒使用,通常狀況下下面兩對SQL語句的返回結果是同樣的。 當關繫條件只有一個時: select * from A where A.id in (select B.id from B) select * from A where exists (select NULL from B where A.id = B.id) 當關繫條件只有多個時: select *
相關文章
相關標籤/搜索