1.
表结构必须相同:
select * from 表1 where not exists (select * from 表2 where 表1.字段A = 表2.字段A)
如:
select * from tsxx where not exists (select * from pandian where pandian.tsbh2 = tsxx.tsbh)
2.
select * from 表1 where 字段A not in ( select 字段A from 表2 where flag = '1')
如:
select * from tsxx where tsbh not in ( select tsbh2 from pandian where flag = '1')
表结构必须相同:
select * from 表1 where not exists (select * from 表2 where 表1.字段A = 表2.字段A)
如:
select * from tsxx where not exists (select * from pandian where pandian.tsbh2 = tsxx.tsbh)
2.
select * from 表1 where 字段A not in ( select 字段A from 表2 where flag = '1')
如:
select * from tsxx where tsbh not in ( select tsbh2 from pandian where flag = '1')