(2)expression [NOT] IN (sqlstatement) 只能在主查询检索那些记录。 expression: 用以搜寻子查询结果集的表达式。 eg: select * from table1 where field1 in (select field2 from table2); //field1通常等同field2 等价于select * from table1,(select distinct field2 from table2 ) table2 where table1.field1 = table2.field;
(3)[NOT] EXISTS (sqlstatement) select * from table1 where exists ( select null from table2 where field2= field1);