select t1.codpat,razsoc,IFNULL((select count(codevepar) from gevmdeventosparticipantes where (stapattra='S') and (codpat=t1.codpat) and (codeve='@1') limit 1
),'    ') as transporte,IFNULL((select count(codevepar) from gevmdeventosparticipantes where (stapathos='S') and (codpat=t1.codpat) and (codeve='@1') limit 1
),'    ') as hospedaje,IFNULL((select count(codevepar) from gevmdeventosparticipantes where (stapatinc='S') and (codpat=t1.codpat) and (codeve='@1') limit 1
),'     ') as inscritos from gevtcpatrocinantes as t1,gevmdeventospatrocinante as t2 where (codeve='@1') and (t1.codpat=t2.codpat) and (t1.codpat=t2.codpat) order by razsoc