【问题标题】:how to merge/Combine two tables in oracle如何在oracle中合并/合并两个表
【发布时间】:2020-09-29 07:00:08
【问题描述】:

您好,我想在 oracle 中合并两个表,如下所示 -

我尝试了以下堆栈溢出的答案,但没有得到输出表

这样的答案

Combining Two Tables With Oracle SQL

【问题讨论】:

    标签: sql oracle merge


    【解决方案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
    

    【讨论】:

    • 面临ORA-00933: SQL command not properly ended 错误
    【解决方案2】:

    使用union all

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-16
      • 1970-01-01
      • 2022-10-01
      • 2015-05-27
      • 2020-09-18
      • 2021-09-19
      相关资源
      最近更新 更多