As far as I know mysql GROUP BY groups to the last record found.
Is there any solution to GROUP BY the first record?
I have setup the ORDER in SQL command an
Add LIMIT 1 to your query.
LIMIT 1