联合表以从所有表中获取唯一记录集的正确方法是什么?

问题描述 投票:0回答:1

我有以下示例:

tablexample

而且我不知道如何在这些表之间进行适当的合并

sql hana
1个回答
0
投票

列是否不同?如果是这样,只需将它们填充为空:

select a, b, c, null as d from t1 union all
select a, b, c, null as d from t2 union all
select a, b, c, null as d from t3 union all
select a, b, c, null as d from t4 union all
select a, null as b, null as c, d from t5 union all
select a, null as b, null as c, d from t6 union all
select a, null as b, null as c, d from t7
© www.soinside.com 2019 - 2024. All rights reserved.