表1:
tconst attr_a attr_b attr_c
表2:
tconst attr_d attr_e
我想要什么:
tconst attr_a attr_b attr_c attr_d attr_e
注意: table1和table2中的tconst是不同的数字,没有交集
有人可以帮忙吗?谢谢!
答案 0 :(得分:1)
您可以尝试执行以下操作,以使union
中的两个语句具有相同的列数:
select tconst , attr_a , attr_b , attr_c, null attr_d, null attr_e
from table1
union all
select tconst , null attr_a , null attr_b , null attr_c, attr_d, attr_e
from table2