I'm trying to make this query ordering by date before the group by. I already tried some "solutions" which i found on stackoverflow but nothing worked.
The query is working just fine expect ordering by date.
SELECT *
FROM
guth_matchtable g
JOIN smp_scout_match_application scma
ON scma.guthmatchid = g.guthmatchid
JOIN smp_scout_match_application_cost smac
ON scma.id = smac.applicationid
WHERE scma.userid = 5997
AND g.teamidhome IN (6384)
GROUP BY g.teamidhome,
smac.coststype
ORDER BY g.dateofmatch DESC ;