VETER└-1 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="VE1 M" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpollaPerellˇCamarlesTortosaDeltebreJes˙s Total Punts
1 GRUESO OTALO, ANTONIO 1151150000 230 230
2 BALAGUE BELTRAN, JOAQUIN 93930000 186 186
3 RIERA FLORES, JORDI 10300000 103 103
4 ALBACAR CLIMENT, CONRAD 01030000 103 103
5 POQUET DOMENECH, PAU 8500000 85 85
6 ORTEGA BLANCO, JAIME 0850000 85 85
7 FUSTER GIL, ANGEL LLUIS 0790000 79 79
8 BRULL MARGALEF, JORDI 0750000 75 75
9 SAMANIEGO GOMEZ, XAVI 0730000 73 73
10 ALBIAC VIĐOLAS, FERRAN 0710000 71 71
11 GONZ└LEZ CORTINA, OSCAR 0700000 70 70