SQL求助!count子查询问题,
select '合计', sum(case when a.Pid='999' then (select count(*) from TParty tp where a.fiID=tp.fsID) else null end), sum(case when a.Pid='999' then round(a.ffValue/10000.00,2) else null end)from CaseGP a
select '合计', sum(case when a.Pid='999' then b.num else null end), sum(case when a.Pid='999' then round(a.ffValue/10000.00,2) else null end)from CaseGP a,(select count(*) as num from TParty tp,CaseGP c where c.fiID=tp.fsID) as b