M└STER-1 MASCUL═

SELECT nom as sujeto, dni as doc, sexe as sex1, categoria as cate, IFNULL((SELECT puntscat FROM historic WHERE idcursa=130 AND dni=doc ),0) AS una, IFNULL((SELECT puntscat FROM historic WHERE idcursa=131 AND dni=doc ),0) AS dos, IFNULL((SELECT puntscat FROM historic WHERE idcursa=132 AND dni=doc ),0) AS tres, IFNULL((SELECT puntscat FROM historic WHERE idcursa=133 AND dni=doc ),0) AS quatre, IFNULL((SELECT puntscat FROM historic WHERE idcursa=134 AND dni=doc ),0) AS cinc, IFNULL((SELECT puntscat FROM historic WHERE idcursa=135 AND dni=doc ),0) AS sis, IFNULL((SELECT puntscat FROM historic WHERE idcursa=136 AND dni=doc ),0) AS siet, IFNULL((SELECT puntscat FROM historic WHERE idcursa=137 AND dni=doc ),0) AS vuit, IFNULL((SELECT puntscat FROM historic WHERE idcursa=138 AND dni=doc ),0) AS nou, IFNULL((SELECT puntscat FROM historic WHERE idcursa=139 AND dni=doc ),0) AS deu, IFNULL((SELECT puntscat FROM historic WHERE idcursa=140 AND dni=doc ),0) AS once, SUM(puntscat) AS punts, SUM(empat) as desempat FROM historic WHERE categoria="MA1 M" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpostaL'AmpollaUlldeconaPerellˇS.BÓrbaraCamarlesTortosaJes˙sDeltebreLa GaleraL'Aldea Total Punts
1 MIRO ANDREU , ANTONI 115115000000000 230 230
2 SANCHO JOSE, VICTOR 93103000000000 196 196
3 LANGE EBRI, ARTURO 7185000000000 156 156
4 BROUGHTON, JIM 6973000000000 142 142
5 VELASCO, PASCAL 1030000000000 103 103
6 FERR╦ CANALS, TONI 093000000000 93 93
7 CID ESPUNY, JOSEP LLUIS 850000000000 85 85
8 PELEGRIN SANCHEZ, JOAN CARLES 790000000000 79 79
9 TOM└S TORRES, ISMAEL 079000000000 79 79
10 ARASA ARASA, JUAN JOSE 750000000000 75 75
11 BENIKEN, KAMEL 075000000000 75 75
12 GARRIGA ALMO, FRANCISCO 730000000000 73 73
13 HERNANDEZ RODRIGUEZ, CARLOS 700000000000 70 70
14 MILLAN MASDEU, JOAN IGNASI 680000000000 68 68