使用 SAP HANA 資料庫合併具有相似列名稱的 2 個表
可以透過如下使用 UNION 或 UNION ALL 運算子來完成此操作
select id, Empl_name, DeptId from table1 union select id, Empl_name, DeptId from table2
UNION 和 UNION ALL 之間的區別在於,UNION 會刪除重複項,而 UNION ALL 也會顯示重複項。
廣告
可以透過如下使用 UNION 或 UNION ALL 運算子來完成此操作
select id, Empl_name, DeptId from table1 union select id, Empl_name, DeptId from table2
UNION 和 UNION ALL 之間的區別在於,UNION 會刪除重複項,而 UNION ALL 也會顯示重複項。