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 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="VE1 F" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpostaL'AmpollaUlldeconaPerellóS.BàrbaraCamarlesTortosaJesúsDeltebreLa GaleraL'Aldea Total Punts
1 MARQUEZ GARCIA, SILVIA 11511511500000000 345 345
2 FORT RODRIGUEZ, ROSANA 9301031150000000 311 311
3 PELLICER MARTINEZ, SANDRA 85939300000000 271 271
4 ALSO ROIGET, TERE 103103000000000 206 206
5 CABALLÉ FABRA, RAQUEL 7000930000000 163 163
6 COMES I FORASTERO, PILI 7907500000000 154 154
7 REDO VIUDEZ, SUSANA 0756900000000 144 144
8 VINAIXA REY, MONTSERRAT 0001030000000 103 103
9 CALLARISA BEL, CELIA 008500000000 85 85
10 ZARAGOZA GRANELL, SUSANA 085000000000 85 85
11 ROYO DELLA, JUDHIT 007900000000 79 79
12 VALLS PEDRET, ISABEL 079000000000 79 79
13 ESTORACH ARASA, MIRIAM 750000000000 75 75
14 TORTA, CARME 730000000000 73 73
15 BEL POCURULL, SONIA 007300000000 73 73
16 GARCIA FUENTES, ARACELI 073000000000 73 73
17 FALCÓN TORMO, EVA 710000000000 71 71
18 MONTENEGRO, LÍDIA 071000000000 71 71
19 VALLS RIOS, PATRICIA 007100000000 71 71
20 DE LA IGLESIA TUDELA, OLYMPIA 007000000000 70 70
21 RUIZ MARTINEZ, VANESSA 690000000000 69 69
22 IRIGOYEN GARCIA, SILVIA 680000000000 68 68
23 SORIANO, EVA 006800000000 68 68
24 IBAÑEZ ARTIGAS, TRINI 670000000000 67 67
25 GARCÍA SABATER, RUTH 006700000000 67 67
26 LARA, CLARISA 660000000000 66 66
27 LLOPIS MONZO, MÓNICA 006600000000 66 66
28 COMÍ CODINA , SÒNIA 650000000000 65 65