从3个结构相同的表中选出同一个字段(distinct)怎么写SQL?(100分)

  • 主题发起人 Restart1
  • 开始时间
R

Restart1

Unregistered / Unconfirmed
GUEST, unregistred user!
A,B,C3个表,选出This字段,但是要distinct的,一句SQL怎么说?
我用ADOQuery。
 
select distinct xx from
(select xx from a
union
select xx from b
union
select xx from c
)
 
好像union 就是distinct的,union all 是全部的
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
986
SUNSTONE的Delphi笔记
S
S
回复
0
查看
804
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
757
DelphiTeacher的专栏
D
顶部