SELECT nombre, (
SELECT slug
FROM clubs
WHERE rowid = club
)club, SUM( goles ) gol
FROM `sheets_match` sm
INNER JOIN sheets_match_players smp ON sm.id = smp.id_planilla
INNER JOIN players p ON smp.ficha = p.card
INNER JOIN tournament t ON sm.torneo=t.id
WHERE goles >0
AND p.club=169
AND t.id_categoria NOT IN ( 6, 7 )
AND torneo=
GROUP BY card
ORDER BY SUM( goles ) DESC, nombre ASC