VETERÀ-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 tres, IFNULL((SELECT puntscat FROM historic WHERE idcursa=132 AND dni=doc ),0) AS dos, 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, SUM(puntscat) AS punts, SUM(empat) as desempat FROM historic WHERE categoria="VE1 M" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpostaL'AmpollaUlldeconaPerellóS.BàrbaraCamarlesTortosaDeltebreLa GaleraJesús Total Punts
1 MAS CACERES, LLUISMA 115115103115115103115000 781 781
2 ALEMANY SEBASTIA , SAMUEL 1031039310310393103000 701 701
3 OLIVA SIMÓ, JUAN JOSÉ 69698585797385000 545 545
4 CASTELLS LOPEZ, RAMON 70687571717079000 504 504
5 CURTO I GILABERT, DAVID 67656868706767000 472 472
6 SOTA MARTÍ, JORDI 7975737975710000 452 452
7 ALABART ALCOBER, JOSEP MARIA 0707075736993000 450 450
8 ZARAGOZA VALLDEPEREZ, RAMON 59576664676264000 439 439
9 ULLDEMOLINS TODÓ, ALFONS 6658070686466000 392 392
10 PAGA MARGALEF, JOAN PERE 6561676906561000 388 388
11 LUQUE LLUCH, OLIVER 44424953535251000 344 344
12 PRINCEP CARDONA, JESUS 75790938500000 332 332
13 ROMEU ESQUERRÉ, FERNANDO 5050610545555000 325 325
14 QUERAL FORCADELL, XAVI 093115001150000 323 323
15 CASTELLS FABRA, LLUIS 39374849464547000 311 311
16 VALLESPI DE LA CRUZ, JORDI 06771730075000 286 286
17 SOTOMAYOR DUQUE, XAVI 415163656600000 286 286
18 MONTESÓ JIMENEZ, DAVID 574860606100000 286 286
19 DELLA CALLEN, JUAN JOSE 524959006060000 280 280
20 RODRIGUEZ SUBIRATS, DAVID 00690696373000 274 274
21 SEBASTIA VALLDEPEREZ, JORDI 464458636200000 273 273
22 ALIMBAU REVERTE, MIQUEL 05964666400000 253 253
23 MARGALEF JORNET, PERE 7373009300000 239 239
24 OLIVA SORIA, ANTONIO 61605461000000 236 236
25 MARTOS MARTI, ANGEL 05562576000000 234 234
26 QUERALT ROIG, DANI 58520625900000 231 231
27 FERNANDO ROYAL, JOSEP ENRIC 55005657580000 226 226
28 MARTIN ARASA, JOSEP 54005458530000 219 219
29 FANDOS COLOMINES, FELIP 00050494850000 197 197
30 MARTI GUARI, DAVID 42005105049000 192 192
31 REVERTER BULLON, JOSE MIGUEL 45051048460000 190 190
32 SORIANO LÓPEZ, MARTÍ 085000850000 170 170
33 ARAGON MORA , FELIP 4900005453000 156 156
34 GRUESO OTALO, ANTONIO 850000070000 155 155
35 CUGAT MULET, JAUME 4341000590000 143 143
36 MARGALEF BENAIGES, PAU 000670071000 138 138
37 CÓZAR TORÁN, PEDRO 686600000000 134 134
38 LLEIXA GUARRO, IVAN 640650000000 129 129
39 GARCIA SUAREZ, JULIO CESAR 000063062000 125 125
40 LLUCH ARBONA, DAVID 054000610000 115 115
41 GRATOVIL PEREZ, ENRIC 000005659000 115 115
42 DELLA CALLEN, CARLOS 000005756000 113 113
43 CID MESEGUER, SIMON 565300000000 109 109
44 BALAGUE BELTRAN, JOAQUIN 470570000000 104 104
45 SANS FERRER, ALBERT 004700052000 99 99
46 ALBA RODRIGUEZ, TONI 510000430000 94 94
47 BELLART SANS, MIQUEL 93000000000 93 93
48 SERRET GOMEZ, JUAN CARLOS 039500000000 89 89
49 PÉREZ SANZ, RAÚL 000004244000 86 86
50 VILAR ALCÁZAR, DAVID 00000790000 79 79
51 NOU CASTELL, RAMON 00790000000 79 79
52 CAPELL BUENDIA, ANTONI 00000750000 75 75
53 ALBESA ABADAL, ANDRES 71000000000 71 71
54 GAS PANISELLO, DAVID 07100000000 71 71
55 MATHEU GAS, XAVI 00000069000 69 69
56 ROYO GUILLEM, ANDREU 00000680000 68 68
57 RUBIO DIAZ, MARC 00000068000 68 68
58 BUERA REBULLIDA , JOSEP MIQUEL 00000660000 66 66
59 OLLE CAMPAMA, FRANCESC 00000065000 65 65
60 MOTES MARTINEZ, LUIS 00006500000 65 65
61 ESCUDERO COROMINES, DANI 06400000000 64 64
62 DUEÑAS RODRIGUEZ, ALBERTO 06300000000 63 63
63 ASÍN QUEROL, JAVI 63000000000 63 63
64 FRANCH MARRO, XAVIER 00000063000 63 63
65 LOPEZ GIL, DENIS 62000000000 62 62
66 FERNANDEZ FUERTES, ALEX 06200000000 62 62
67 MORENO GARCIA, JUAN 60000000000 60 60
68 JUANPERE POBLET, MANEL 00059000000 59 59
69 BUSTINDUY CASTILLO, IVÁN 00000058000 58 58
70 MARGALEF LLAO, TIBURCI ANDREU 00058000000 58 58
71 ALEIXENDRI ARRIBA, RAMON 00000057000 57 57
72 CALDUCH GARCIA, JUAN 05600000000 56 56
73 VALMAÑA, ELOY 00005600000 56 56
74 RIBAS BEL, ALBERT 00560000000 56 56
75 CASTEJON, JOSE 00005500000 55 55
76 SUOMINEN, IRRON 00550000000 55 55
77 ALFONSO GOMEZ, SANTIAGO 00055000000 55 55
78 BORRAS MARTINEZ, GERARD 00000054000 54 54
79 SORIANO LOPEZ, ANTONIO 53000000000 53 53
80 VACHERESSE ORTIZ, STEPHANE 00530000000 53 53
81 CIFRE SOSPEDRA, JOSE ANGEL 00520000000 52 52
82 TORRES , JORGE 00005200000 52 52
83 AZNAR RUIZ, CHRISTIAN 00052000000 52 52
84 TORRENT NAVARRO, ENRIC 00000510000 51 51
85 ALÚTIZ ESPAÑA, XAVIER 00005100000 51 51
86 JIMÉNEZ CATALÁ, ANDREU 00005000000 50 50
87 VAQUERIZO RODRIGUEZ, EDUARDO 00000490000 49 49
88 AGUILAR BONAVIDA, ESTEVE 48000000000 48 48
89 ALEIXANDRI AUDÍ , JOSEP RAMON 00000048000 48 48
90 ROMERO VILLANUEVA, JUAN CARLOS 04700000000 47 47
91 TORRES BERTOMEU, JOSEP 00000470000 47 47
92 VARELA, JOSEP MANEL 00004700000 47 47
93 CABRÉ, MARIÀ 04600000000 46 46
94 CANO LEON, RICARDO 00000046000 46 46
95 SOTO PAREDES, DANIEL 04500000000 45 45
96 BORUP, SINE 00000045000 45 45
97 CLUA GAYA, MARC 00000440000 44 44
98 MARINAS VALLS, IVAN 04300000000 43 43
99 ROSELLO CASTELLS, ORIOL 00000410000 41 41
100 TERAN GOMEZ, JOAN 40000000000 40 40
101 ALVAREZ GUTIERREZ, RUBEN 04000000000 40 40
102 PRADES PRADES, JOSEP M. 03800000000 38 38
103 ALVENTOSA LARA, RAFAEL 03600000000 36 36
104 FRANCH BONET, ROSANA 03500000000 35 35