select * from sqdta.retire where PersonID=1000003 union all select * from sqdta.retireNd where PersonID=1000003因为两个表中的字段不一样,所以执行时报错
有什么办法能把两个表联合起来?
相同的字段合并,不同的字段分别显示?
有什么办法能把两个表联合起来?
相同的字段合并,不同的字段分别显示?
调试欢乐多
如:
a:c1,c2
b:c1,c3
select c1,c2,null as c3 from a
union
select c1,null as c2,c3 from b