select * from a表 where not exists (select * from b表) select * from a表 where exists (select * from b表)
select * from table1 a,table2 b where a.id=b.id select * from table1 a,table2 b where a.id=*b.id select * from table1 a,table2 b where a.id*=b.id select * from table1 where id in(select id from table2)
与: select * from table1 a,table2 b where a.id=b.id; 或: (select * from table1 union select * from table2) minus select * from table1 a,table2 b where a.id=b.id; 非: select * from table1 minus select * from table2;
select * from a表 where exists (select * from b表)
select * from table1 a,table2 b where a.id=*b.id
select * from table1 a,table2 b where a.id*=b.id
select * from table1 where id in(select id from table2)
select * from table1 a,table2 b where a.id=b.id;
或:
(select * from table1 union select * from table2)
minus
select * from table1 a,table2 b where a.id=b.id;
非:
select * from table1 minus select * from table2;