select * from table2 a where not exists(select 1 from table1 b where a.uid=b.uid)--2 select * from table2 a where not in(select uid from table1 b where b.uid is not null)
select * from table2 a where not exists(select 1 from table1 b where a.uid=b.uid);
一般用not existsnot in 的改为select * from table2 a where a.uid not in(select uid from table1 b where b.uid is not null)
--落了 select * from table2 a where a.uid not in(select uid from table1 b where b.uid is not null)
select * from table2 a where not in(select uid from table1 b where b.uid is not null)
一般用not existsnot in 的改为select * from table2 a where a.uid not in(select uid from table1 b where b.uid is not null)
select * from table2 a where a.uid not in(select uid from table1 b where b.uid is not null)