VETERÀ-1 FEMENÍ

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 F" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpostaL'AmpollaUlldeconaPerellóS.BàrbaraCamarlesTortosaDeltebreLa GaleraJesús Total Punts
1 PELLICER MARTINEZ, SANDRA 798579103000000 346 346
2 REDO VIUDEZ, SUSANA 103093115000000 311 311
3 CABALLÉ FABRA, RAQUEL 68757079000000 292 292
4 MONSERRAT MONTAGUT, SÍLVIA 67707173000000 281 281
5 VALLS RIOS, PATRICIA 69716971000000 280 280
6 GISBERT TORTA, VERÒNICA 01037593000000 271 271
7 BONET MONTAGUT, MARIA JOSÉ 64686770000000 269 269
8 MELICH CAÑADO, LARA 62636569000000 259 259
9 GALVE CURTO, LUCI 7579085000000 239 239
10 COMES I FORASTERO, PILI 859300000000 178 178
11 BLANCH VOLTES, TERE 737300000000 146 146
12 FALCÓN TORMO, EVA 706900000000 139 139
13 BERTOMEU CASANOVA, RAQUEL 064680000000 132 132
14 RUS GARCIA, PILAR 115000000000 115 115
15 DRAGO CANES, ANDREA 011500000000 115 115
16 LLUCH, MARTA 001150000000 115 115
17 GIRALDEZ ALVARO, EMI 001030000000 103 103
18 MARTINEZ MENDOZA, MARIA 93000000000 93 93
19 BEL POCURULL, SONIA 00850000000 85 85
20 VALLS BORRELL, JOSEPA 00075000000 75 75
21 CÓRDOVA ANDINO , YESENIA S. 00730000000 73 73
22 PONS CORTES, ROSA 71000000000 71 71
23 ESTRELLA ARQUIETA, VIVIANA 06700000000 67 67
24 VILANOVA RODRIGUEZ, SONIA 06600000000 66 66
25 VIDAL LOTO, PILI 66000000000 66 66
26 OCAÑA CABANES, MÒNICA 00660000000 66 66
27 OBRADOS MURIA, MONTSE 06500000000 65 65
28 RUIZ MARTINEZ, VANESSA 65000000000 65 65
29 CRISTEA PETECUTA, MARIA 63000000000 63 63