发布网友 发布时间:2小时前
共1个回答
热心网友 时间:6分钟前
给子查询加个别名就可以了。
select a.org,a.baogao from (select produce_pjname as org,ISNULL((select sum(produce_amount) from T_produce b where Produce_type='报告' and b.Produce_pjname=a.Produce_pjname group by a.Produce_pjname),0)) as baogao from T_produce a group by Produce_pjname) a