SELECT count( e.id ) , sum( e.zeit ) AS sum_zeit, sum( e.laenge ) AS sum_laenge, fk_runner, week(datum), year(datum)
FROM `trainingseinheit` e, trainingsstrecke s
WHERE e.`fk_trainingsstrecke` = s.id
GROUP BY s.fk_runner, week(datum), year(datum)
ORDER BY year(datum) desc, week(datum) desc, sum_zeit desc
LIMIT 0 , 90
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
SELECT count( e.id ) , sum( e.zeit ) AS sum_zeit, sum( e.laenge ) AS sum_laenge, fk_runner, week(datum), year(datum)
FROM `trainingseinheit` e, trainingsstrecke s
WHERE e.`fk_trainingsstrecke` = s.id
GROUP BY s.fk_runner, week(datum), year(datum)
ORDER BY year(datum) desc, week(datum) desc, sum_zeit desc
LIMIT 0 , 90