很简单的SQL问题不会!大家帮忙!(20分)

T

tank37

Unregistered / Unconfirmed
GUEST, unregistred user!
表1 t1
记录是
1, 2, 3

表2 t2
记录是
1, 2, 3, 4, 5
怎样从2个表中找出不同的记录 4,5
 
select * from t2 where field1 not in (select field1 from t1);
 
笨方法,大体就这个格式,不过记得oracle 中有一个关键字可以写的方便一些。
select * from
(
select t1.field1
from t1
where t1.field1 not in
(
select t2.field
from t2
)
)
union
(

)
 

Similar threads

回复
0
查看
915
不得闲
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
S
回复
0
查看
954
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
顶部