SÈNIOR FEMENÍ

SELECT nom as sujeto, dni as doc, sexe as sex1, categoria as cate, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=221 AND dni=doc ),0) AS una, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=222 AND dni=doc ),0) AS dos, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=223 AND dni=doc ),0) AS tres, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=224 AND dni=doc ),0) AS quatre, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=225 AND dni=doc ),0) AS cinc, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=226 AND dni=doc ),0) AS sis, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=227 AND dni=doc ),0) AS siet, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=228 AND dni=doc ),0) AS vuit, IFNULL((SELECT puntscat FROM historic5 WHERE idcursa=229 AND dni=doc ),0) AS nou, SUM(puntscat) AS punts, SUM(empat) as desempat FROM historic5 WHERE categoria="SEN F" GROUP BY dni ORDER BY punts DESC, desempat ASC..
Pos Nom AmpostaAmpollaPerellóCamarlesTortosaJesúsDeltebreL'Aldea Total Punts
1 SUBIRATS ABELLA, ANNA 115103000000 218 218
2 GIMÉNEZ FERRERES, CLÀUDIA 103115000000 218 218
3 AGUILÀ CUBELLS, ANNA 7979000000 158 158
4 CASTELBLANQUE SOLER, AIDA 930000000 93 93
5 SANCHEZ, JEANNE 093000000 93 93
6 VALMAÑA CALBET, CINTA 085000000 85 85
7 FORCADELL MONTSERRAT, JESSICA 850000000 85 85
8 COTAINA GILABERT, ELISABET 075000000 75 75
9 CARTOIXÀ BENAIGES, CINTA 750000000 75 75
10 PÉREZ MÁRQUEZ, JÉSSICA 073000000 73 73
11 GONZÀLEZ GARRIGA, ARIADNA 730000000 73 73