select razsoc,(select count(codevepar) from gevmdeventosparticipantes where (codeve='@1') and (codpat=gevtcpatrocinantes.codpat) and (stapattra='S') and (tippre<>'N')) as canpattra,(select count(codevepar) from gevmdeventosparticipantes where (codeve='@1') and (codpat=gevtcpatrocinantes.codpat) and (stapathos='S') and (tippre<>'N')) as canpathos,(select count(codevepar) from gevmdeventosparticipantes where (codeve='@1') and (codpat=gevtcpatrocinantes.codpat) and (stapatinc='S') and (tippre<>'N')) as canpatinc from gevtcpatrocinantes where (codpat in (select codpat from gevmdeventosparticipantes where (codeve='@1') and (tippre<>'N')))

union all

select '',0 as canpattra,0 as canpathos,(select count(codevepar) from gevmdeventosparticipantes where (codeve='@1') and (codpat='') and (tippre='N')) as canpatinc 
