I’ve tried this query, but the result is just every “max_deltakelser” and not only the ones that have the highes value? Any idea about what’s wrong?
SELECT sptSyklistID
, MAX( deltakelser
) AS max_deltakelser
FROM (
SELECT sptSyklistID
, COUNT( sptSyklistID
) AS deltakelser
FROM mck_syklist_pa_tur
, mck_syklist
WHERE syklistID
= sptSyklistID
GROUP BY sptSyklistID
)
AS syklister
GROUP BY sptSyklistID
Cato