Closed Meigyoku-Thmn closed 3 years ago
It is not a bug. Group By discards any ordering declared before,
Thanks. I also just realized that MySQL ignores ORDER BY clause in sub query so this will never work anyway.
It's common sense. Grouping is complex algorithm which uses hashes, other techniques. And believe me, ordering after that is discarded anyway.
This is a weird bug. With a query like this:
then the generated sql doesn't have the order by clause:
There must be an ORDER BY clause at the end, or a nested query with ORDER BY clause.