我有两个表(表 A 和表 B).
I have two tables (Table A and Table B).
这些有不同的列数 - 假设表 A 有更多的列.
These have different number of columns - Say Table A has more columns.
如何合并这两个表并为表 B 没有的列获取空值?
How can I union these two table and get null for the columns that Table B does not have?
为列数较少的表添加额外的列为空,如
Add extra columns as null for the table having less columns like
Select Col1, Col2, Col3, Col4, Col5 from Table1
Union
Select Col1, Col2, Col3, Null as Col4, Null as Col5 from Table2
这篇关于联合两个不同列数的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!