用合并
select a.num, a.name from a
union
select b.num,b.name from b
select a.num, a.name from a
union
select b.num,b.name from b
解决方案 »
- fastreport 两个问题一起来,在线等,简单的
- 请问该如何访问一个web上的mdb文件,急
- 谁知道,这个控件的ShellTreeView的属性和介绍,我给50分
- 谁有ICD10编码表?给我一份好吗?
- 有关ini的问题 请教
- 庆祝重生.顺便赔礼道歉.感谢版主老大!!!
- 高分求购!!!哪位知道《delphi编程技巧(网络和数据库篇)》这本书的电子文档的下落。急需!!!!
- 来者有分!!!!!!!!
- 一个数据库的程序 编译以后 在别的机器上不能用 说什么引擎出错,我该怎么办啊
- 谁愿提供串口操作程序!
- 安装了delphi后,我又安装了.net然后运行delphi6,出现了选择debug的问题!!!!
- 我做了一个网站请大家指导~
a b
id name id name
2 aaa 3 ccc
2 aaa 3 ccc
2 aaa 2 aaa
2 aaa
1 mmm
用select * from a union select * from b:
id name
1 mmm
2 aaa
3 ccc
可是我希望有8条记录,怎么会是》?
select ‘0’ bh,a.num, a.name from a
union
select '1' bh, b.num,b.name from b//--增加一个任意字段
***********************************
select a.num, a.name from a
union all
select b.num,b.name from b
***********************************
怎么样?
欢呼吧!!!