SČNIOR 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="SEN M" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpollaPerellóCamarlesTortosaDeltebreJesús Total Punts
1 TOMŔS BUITRAGO, AITOR 011511511500 345 345
2 ALCOVERRO FABREGAT, LEO 1037970000 252 252
3 ROCA REY, ROGER 937569000 237 237
4 GOMEZ AUSACH, ANDREU 115850000 200 200
5 ESTORACH SOL, OSCAR 009310300 196 196
6 SOWE , MUSA 01030000 103 103
7 COVAS DOMENECH, KEVIN 00103000 103 103
8 ANTÚNEZ TIRADO, JOSE 0009300 93 93
9 CABALLÉ ANDREU, ENRIC 0930000 93 93
10 HERNANDEZ GARRIDO, GERARD 0085000 85 85
11 MATAMOROS, SERGI 0008500 85 85
12 GOLENEVA, ASYA 8500000 85 85
13 MACHI CABALLE, OMAR 0079000 79 79
14 OBIOL PEDROL, ENRIC 0007900 79 79
15 BERTOMEU BELLES, CRISTIAN 0075000 75 75
16 MONLLAO FERRE, PAU 0073000 73 73
17 MECA VENTURA, CARLOS 0071000 71 71
18 MAURI HIERRO, DAVID 0068000 68 68