期望效果:(我是拿到一對關係去另一表中的一對關係去對比)select * From Empoylee Where(Address1,Address2) in(Select Address1,Address2From EmpoyleeAdressesWhere Country = 'Canada')以上無法實現用這種方案也可以實現 不過速度很慢的select * from (select (zcbm ||','||fwbm) as t from T_FWZC ) tt where t not in(select (zcbm ||','||fwbm) as c from T_ZC_FC_GX)解決方案1:用exists判斷select a.* From Empoylee aWhere exists (select 'A' from EmpoyleeAdresses b Where b.Country = 'Canada' and a.Address1=b.Address1 and a.Address2=b.Address2 )解決方案2:用inner join內連結select *FromEmpoyleeinner join EmpoyleeAdressesonEmpoylee.Address1=EmpoyleeAdresses.Address1andEmpoylee.Address2=EmpoyleeAdresses.Address2WhereEmpoyleeAdresses.Country = 'Canada')select * fromEmpoylee eminner join EmpoyleeAdresses emAonem.Address1=emA.Address1andem.Address2=emA.Address2andemA.Country = 'Canada'解決方案3:表關聯select a.*From Empoylee a , (Select Address1,Address2 From EmpoyleeAdresses Where Country = 'Canada') bWherea.Address1=b.Address1anda.Address2 = b.Address2主觀感覺方案1更快一些,客觀上,還沒在查詢分析器裡用"顯示執行計畫"看哪種寫法效率高些. 如果是Delete語句,寫法如下:Delete From Empoylee Where exists (select 'A' from EmpoyleeAdresses b Where b.Country = 'Canada' and Empoylee.Address1=b.Address1 and Empoylee.Address2=b.Address2 )注意Delete from 後的表不能用別名~