SÈNIOR 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="SEN F" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpostaL'AmpollaUlldeconaPerellóS.BàrbaraCamarlesTortosaJesúsDeltebreLa GaleraL'Aldea Total Punts
1 ESCUDERO BARBERÀ, CINTA 93931031030000000 392 392
2 VIDIELLA PIÑOL, SANDRA 001151150000000 230 230
3 SANCHO FERRÉ, ANDREA 103115000000000 218 218
4 CABALLÉ FABRA, GEMMA 01030930000000 196 196
5 MESEGUER CARBÓ, LINA 0085850000000 170 170
6 FERRE GARCIA, NOELIA 0075730000000 148 148
7 DRAGO ROSA, HELENA 1150000000000 115 115
8 GIMÉNEZ FERRERES, CLÀUDIA 009300000000 93 93
9 JORNET SABATÉ, MIRIAM 850000000000 85 85
10 SEGARRA MAYO, ANNA 085000000000 85 85
11 GARCIA HOMS, LORENA 007900000000 79 79
12 GONZALEZ LLOP, MARTA 000790000000 79 79
13 ALIAU CLUA, SANDRA 079000000000 79 79
14 RUIZ SEVILLA, ÀNGELA 000750000000 75 75
15 BOYER MARGALEF, ALBA 000710000000 71 71