可以用unionAll(tableA, tableB, [byColName=false]),其中当 byColName =true 时,各表可有不同数量的列。若某列在某些表中不存在,结果中会以空值填充。当 byColName =false 时,各表必须有相同数量的列。
re=unionAll(t1,t2,true)
请问把一个内存表插入到另外一张内存表,能够自动对齐列名,且多出的列能够自动补上去,有什么方法吗?
例如有下表t1和t2:
t1=table(1 2 3 as id, 11 12 13 as x,1..3 as y) t2=table(4 5 6 as id, 4..6 as y)
想得到:
id x y 1 11 1 2 12 2 3 13 3 4 4 5 5 6 6