數(shù)據(jù)庫in和exists的區(qū)別 sql中exists是什么意思,怎么講解?
sql中exists是什么意思,怎么講解?Exists 方法 描述如果在 Dictionary 對象中指定的關(guān)鍵字存在,返回 True,若不存在,返回 False。舉個例子吧:select * fro
sql中exists是什么意思,怎么講解?
Exists 方法 描述如果在 Dictionary 對象中指定的關(guān)鍵字存在,返回 True,若不存在,返回 False。舉個例子吧:select * from a where exists(select * from b where a.id = b.id)a表和b表使用id關(guān)聯(lián),這條語句的含義是,當(dāng)b表能夠查詢出結(jié)果時,exists(select * from b where a.id = b.id)子句為真,只有滿足exists結(jié)果為真時,才會查詢出a表的記錄。這樣解釋你明白了嗎。