ma se metto ORDER BY al posto di GROUP BY dà l'errore:

Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause