谢谢sywzs,你的
select a0.zd1,表1.zd2,a2.zd3 from (SELECT zd1 FROM 表1 UNION sele zd1 FROM 表2) a0 LEFT OUTER JOIN (select zd1,sum(zd2) as zd3 from 表2 group by zd1) a2 ON a2.zd1=a0.zd1 left outer join 表1 on 表1.zd1=a0.zd1
a0,a2,表1,表2含义不明,能否采用题目中的表A、表B。程序运行出错。
select a0.zd1,表1.zd2,a2.zd3 from (SELECT zd1 FROM 表1 UNION sele zd1 FROM 表2) a0 LEFT OUTER JOIN (select zd1,sum(zd2) as zd3 from 表2 group by zd1) a2 ON a2.zd1=a0.zd1 left outer join 表1 on 表1.zd1=a0.zd1
a0,a2,表1,表2含义不明,能否采用题目中的表A、表B。程序运行出错。