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 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="VE2 M" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpostaL'AmpollaUlldeconaPerellóS.BàrbaraCamarlesTortosaDeltebreLa GaleraJesús Total Punts
1 ORTÍN FONT, XAVIER 115115115115000000 460 460
2 LLUIS LLANSAMA, GABRIEL 1037910375000000 360 360
3 PELEGRIN SANCHEZ, JOAN CARLES 71677369000000 280 280
4 LEON MORA, AUGUSTO LEO 70717168000000 280 280
5 SEDIKI AIT SILARBI, HAKIM 65696765000000 266 266
6 RIBES SERRA, JOSEP MARIA 68657063000000 266 266
7 SERRET ROIG, ADRIA 64666966000000 265 265
8 FORTUÑO NAVARRO, JOSE LUIS 63646867000000 262 262
9 VALDIVIAS AHUMADA, OSCAR 66686164000000 259 259
10 GALARZA SANCHEZ, ALEJANDRO 59605862000000 239 239
11 LLEIXÀ CHAVARRIA, JOSEP 0737979000000 231 231
12 ALMENDROS RODA, IGNASI 0757570000000 220 220
13 CABRERA CABALLÉ, MARCOS 6770650000000 202 202
14 BELTRAN SUBIRATS, JOSEP MARIA 0615961000000 181 181
15 VALENCIA, MANUEL 008585000000 170 170
16 GARCIA SANGÜESA, DAMIÀ 858500000000 170 170
17 GARCIA DRAGO, JOSEP 610640000000 125 125
18 CAÑÍS SÁNCHEZ, DANIEL 606300000000 123 123
19 RAMOS ALFONSO, ANTONIO 010300000000 103 103
20 MONTERO PÈREZ, JOSEP MARIA 000103000000 103 103
21 SERRA BENEDICTO, JOAN 00093000000 93 93
22 VENTURA CASTELLS, JOAN 09300000000 93 93
23 SANCHEZ LLOPIS, ROBERTO 00930000000 93 93
24 TONDA SALVADO, MANEL 93000000000 93 93
25 GRAU SANZ, MAX 79000000000 79 79
26 ALONSO QUESADA, OSCAR 75000000000 75 75
27 GALVE TORRES, JOAN CARLES 00073000000 73 73
28 CAMACHO TEVAS, JOSEP 73000000000 73 73
29 RODES HORTA, GERARD 00071000000 71 71
30 PELLICER DIAZ, JOSEP JOAQUIM 69000000000 69 69
31 FIBLA REVERTER, HERMINI 00660000000 66 66
32 TORRENT OLLÉ, JORDI 00630000000 63 63
33 GRANGÉ GALINDO, JOSEP LLUIS 62000000000 62 62
34 ESPANYA FORCADELL, ANTONI 00620000000 62 62
35 CASTAÑO DE LA ASUNCION, JUAN CARLOS 06200000000 62 62
36 ALBESA RUBIO, XAVIER 00600000000 60 60
37 MONFORTE GARGALLO, PACO 00060000000 60 60