SUB-18 MASCUL═

SELECT nom as sujeto, dni as doc, sexe as sex1, categoria as cate, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=221 AND dni=doc ),0) AS dos, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=222 AND dni=doc ),0) AS una, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=223 AND dni=doc ),0) AS tres, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=224 AND dni=doc ),0) AS quatre, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=225 AND dni=doc ),0) AS cinc, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=226 AND dni=doc ),0) AS sis, SUM(puntscat) AS punts, SUM(empat) as desempat FROM historic5 WHERE categoria="S18 M" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpollaPerellˇCamarlesTortosaDeltebreJes˙s Total Punts
1 FUMADO GISBERT, ORIOL 11593931151150 531 531
2 BAJADOR BATALLA, ALEIX 0001031030 206 206
3 CEBALLOS CAMAĐES , ADRIA 00115000 115 115
4 CAPTARI, FABIAN 01150000 115 115
5 MAURI GALVE, ALBERT 01030000 103 103
6 ESPINOZA GOMEZ, ADRI└ 00103000 103 103
7 AGUILAR RODR═GUEZ, MARC 0009300 93 93
8 PASCUAL VENDRELL, SERGEI 0850000 85 85
9 DE CARALT, ALVARO 0085000 85 85