Reputation: 1123
As this doc said, "You currently cannot use GROUP BY with an ORDER BY clause but this is planned". But we do need to group by one field and order by another field. Is there a way to do it?
Upvotes: 9
Views: 8343
Reputation: 23782
According to my research, i'm afraid that there is no such direct official way to use GROUP BY with ORDER BY since the statement you mentioned in your question:
The GROUP BY clause must be after the SELECT, FROM, and WHERE clause and before the OFFSET LIMIT clause. You currently cannot use GROUP BY with an ORDER BY clause but this is planned.
You could submit your feedback to push the progress of this feature.
If your need is urgent,i would suggest you :
Upvotes: 4