--并发症手术例数 select '6' xh,'其中:并发症发生例数' mc,substr(sjcyrq,1,4) 年,sum(bfzbr) 例数 from ( select sjcyrq,zyid00, (select sign(count(1)) from bq_brzdxx where zdlb00 in ('3','4') and substr(zdm000,1,3) in ('T80','T81','T82','T83','T84','T85','T86','T87','T88') and zyid00=b.zyid00) bfzbr from vw_jcbb_ss_ksgzltj a,zy_brxxb0 b where sjcyrq between PQSRQ00 and PJSRQ00 and SSZT00 in ('2','4') and b.BRZT00 in ('3','4','5') and sslx00='择期' and mzzybz='1' and a.zyghid= b.zyid00 group by sjcyrq,zyid00 ) group by substr(sjcyrq,1,4) ) order by xh;