废话不多说,直接上语句。
1.not in 写法:
select * from table where (field1,field2,field3) not in (select field1,field2,field3 from table)
2.in 写法:把上述例子中的 not in 换成 in 即可。
3.not exists 写法:
select * from table t1 where not exists (select field1,field2,field3 from table t2 and t1.field1=t2.field1 and t1.field2=t2.field2 and t1.field3=t2.field3 )
4.exists 写法:把上述例子中的 not exists 换成 exists 即可。