如何在Oracle中合并/合并两个表

时间:2020-09-29 07:00:08

标签: sql oracle merge

您好,我想像下面那样在oracle中合并两个表-

enter image description here

我从堆栈溢出尝试了以下答案,但没有得到像 Output table

这样的答案

Combining Two Tables With Oracle SQL

2 个答案:

答案 0 :(得分:1)

使用union all

select id, name, rate,total from table1
union all
select id, name, rate,total from table2

答案 1 :(得分:1)

请尝试以下查询:

select * from (
select id, name, rate,total from table1
union all
select id, name, rate,total from table2
) as  t
order by t.id asc
相关问题