查询存在表1 但不存在表2 的所有数据
比如
table 1
T1 T12 T13
1 a A
2 b B
3 C c
table 2
T21 T22 T23
1 a A
5 e E
6 f F
具体查询语句如下:
select A.* from table1 A,table2 B
where A.t11<>B.t21
或者
select * form table1 where T11 not in (
select t21 from table2)
比如
table 1
T1 T12 T13
1 a A
2 b B
3 C c
table 2
T21 T22 T23
1 a A
5 e E
6 f F
具体查询语句如下:
select A.* from table1 A,table2 B
where A.t11<>B.t21
或者
select * form table1 where T11 not in (
select t21 from table2)