VETERÀ-2 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="VE2 M" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpostaL'AmpollaUlldeconaPerellóS.BàrbaraCamarlesTortosaJesúsDeltebreLa GaleraL'Aldea Total Punts
1 ALABART ALCOBER, JOSEP MARIA 851031151030000000 406 406
2 CURTO I GILABERT, DAVID 737593930000000 334 334
3 PUENTES GARCÍA, LUIS FCO 01151031150000000 333 333
4 LLEIXÀ CHAVARRIA, JOSEP 666671850000000 288 288
5 CABANES CALVET, ALBERT 646870750000000 277 277
6 FIBLA REVERTER, HERMINI 626769700000000 268 268
7 FORTUÑO NAVARRO, JOSE LUIS 596366690000000 257 257
8 GRANGÉ GALINDO, JOSEP LLUIS 546465660000000 249 249
9 CAÑÍS SÁNCHEZ, DANIEL 565764670000000 244 244
10 REVERTER BULLON, JOSE MIGUEL 555963650000000 242 242
11 ESCURRIOLA NAVARRO, RAMON 06973790000000 221 221
12 LLUIS LLANSAMA, GABRIEL 67700730000000 210 210
13 SERRET ROIG, ADRIA 65650680000000 198 198
14 MONTERO PÈREZ, JOSEP MARIA 9393000000000 186 186
15 ADELL WINKLER, PERE 52560640000000 172 172
16 SABATER CABRERA, ENRIC 0718500000000 156 156
17 ESQUERRE FERRE, ROMAN 6973000000000 142 142
18 GARCIA DRAGO, JOSEP 5860000000000 118 118
19 FORNÉ CASTELLS, XAVIER 1150000000000 115 115
20 BELTRAN SUBIRATS, JOSEP MARIA 5155000000000 106 106
21 PEREZ MUÑOZ, FRANCISCO JESUS 1030000000000 103 103
22 MONLLEO ROYO, LIBERTO 085000000000 85 85
23 REPISO MARTINEZ, JOAN 079000000000 79 79
24 GRAU SANZ, MAX 790000000000 79 79
25 BELTRAN ARQUES, JUAN FRANCISCO 007900000000 79 79
26 TONDA SALVADÓ, JOSEP LLUIS 750000000000 75 75
27 MARESMA FELIPO, JOAN 007500000000 75 75
28 GARCIA SANGÜESA, DAMIÀ 710000000000 71 71
29 SOTA MARTI, CARLOS 000710000000 71 71
30 ALIMBAU REVERTE, MIQUEL 700000000000 70 70
31 ACERO VENDRELL, ALVARO 680000000000 68 68
32 GUZMAN MORCILLO, PACO 006800000000 68 68
33 MARTORELL RUBIO, JORDI 006700000000 67 67
34 LLETI NAVARRO, FERNANDO 630000000000 63 63
35 MARTI GUARI, DAVID 062000000000 62 62
36 GARCIA REDONDO, DOMINGO 006200000000 62 62
37 LEÓN MORA, AUGUSTO LEO 610000000000 61 61
38 SOLÉ PÀMIES, RAMON 061000000000 61 61
39 GALARZA SANCHEZ, ALEJANDRO 006100000000 61 61
40 VALDIVIAS AHUMADA, OSCAR 600000000000 60 60
41 CABRERA CABALLÉ, MARCOS 058000000000 58 58
42 MASOLLER ARIAS, FRANCESC 570000000000 57 57
43 PEIRET DE LA FUENTE, CARLES 054000000000 54 54
44 TOMÀS I ROIGET, ADAM 530000000000 53 53
45 ARASA CARDONA, RICARD 053000000000 53 53
46 LOZANO HERNANDEZ, JOSE MARIA 500000000000 50 50