SQL表合并 表1:h_app_gb,字段有:timepoint,a,a+,b,b+,c,c+ 表2:h_app_gb_123,字段有:timepoint,a,a+,b,b+
答案:3 悬赏:40
解决时间 2021-01-11 21:33
- 提问者网友:像風在裏
- 2021-01-10 21:11
SQL表合并 表1:h_app_gb,字段有:timepoint,a,a+,b,b+,c,c+ 表2:h_app_gb_123,字段有:timepoint,a,a+,b,b+
最佳答案
- 二级知识专家网友:千夜
- 2021-01-10 21:48
select a,a+,b,b+,c,c+ from 表1 order by timepoint desc
union
select a,a+,b,b+,'' c,'' c+ from 表2 order by timepoint desc
union
select a,a+,b,b+,'' c,'' c+ from 表2 order by timepoint desc
全部回答
- 1楼网友:封刀令
- 2021-01-10 23:05
select * from 表1
union all
select *,'','' from 表2
union all
select *,'','' from 表2
- 2楼网友:上分大魔王
- 2021-01-10 22:43
如果你要把表2的记录添加到表1中:
insert into 表1 (timepoint,a,[a+],b,[b+]) select timepoint,a,[a+],b,[b+] from 表2 order by timepoint desc
如果是要显示两张表记录结果:
select timepoint,a,[a+],b,[b+],c,[c+] from 表1
union
select timepoint,a,[a+],b,[b+],'' c,'' [C+] from 表2 order by timepoint desc
有问题可以追问或Hi我。
insert into 表1 (timepoint,a,[a+],b,[b+]) select timepoint,a,[a+],b,[b+] from 表2 order by timepoint desc
如果是要显示两张表记录结果:
select timepoint,a,[a+],b,[b+],c,[c+] from 表1
union
select timepoint,a,[a+],b,[b+],'' c,'' [C+] from 表2 order by timepoint desc
有问题可以追问或Hi我。
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯