select codparpar,nomparpar,'@1' as codeve,(select count(codevepar) from gevmdeventosparticipantes where (codeve='@1') and (codparpar=gevtparticipaciones.codparpar) and (  (((gevmdeventosparticipantes.tippre='S') or (gevmdeventosparticipantes.tippre='P')) and (stapatinc='S')) or ((tippre='N')) ) ) as cantidad from gevtparticipaciones where (codparpar in (select codparpar from gevmdeventosparticipantes where (codeve='@1')   and (  (((gevmdeventosparticipantes.tippre='S') or (gevmdeventosparticipantes.tippre='P')) and (stapatinc='S')) or ((tippre='N')) )   ))
