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

Sql 联合表以从所有表中获取一组唯一记录的正确方法是什么?,sql,hana,Sql,Hana,我举了以下例子: 我不知道如何在这些表之间进行适当的联合是因为列不同吗?如果是这样,只需将其填充为空: 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,

我举了以下例子:


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

是因为列不同吗?如果是这样,只需将其填充为空:

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

什么是“适当的”联盟?什么是“不适当的”联合?如果问题标题中的“唯一”记录是实际要求,则可以使用
union
而不是
union ALL