如果把两个结构类似的表的记录合并显示?(50分)

  • 主题发起人 主题发起人 wyjpg
  • 开始时间 开始时间
W

wyjpg

Unregistered / Unconfirmed
GUEST, unregistred user!
比如表A<br>FNAME &nbsp;FCOUNT<br>A &nbsp; &nbsp; &nbsp; 10<br>B &nbsp; &nbsp; &nbsp; 20<br>C &nbsp; &nbsp; &nbsp; 25 <br>表B<br>FNAME &nbsp;FCOUNT &nbsp;MONEY<br>D &nbsp; &nbsp; &nbsp; 2 &nbsp; &nbsp; &nbsp; 1.5<br>E &nbsp; &nbsp; &nbsp; 5 &nbsp; &nbsp; &nbsp; 3.0<br>A &nbsp; &nbsp; &nbsp; 6 &nbsp; &nbsp; &nbsp; 2.1 <br>我想用一SQL 语句,把表A及表B的记录合并显示出来,结果如下:<br>FNAME &nbsp;FCOUNT<br>A &nbsp; &nbsp; &nbsp; 10<br>B &nbsp; &nbsp; &nbsp; 20<br>C &nbsp; &nbsp; &nbsp; 25<br>D &nbsp; &nbsp; &nbsp; 2<br>E &nbsp; &nbsp; &nbsp; 5<br>A &nbsp; &nbsp; &nbsp; 6<br>请各位指点.
 
select * from 表A<br>union all<br>select fname, fcount from 表b
 
接下分!放分吧都有答案了!
 
SELECT FNAME,FCOUNT FROM 表A<br>UNION ALL<br>SELECT FNAME,FCOUNT FROM 表b
 
这么简单的问题,也拿上来
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
710
import
I
后退
顶部