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