MySQL 3.23/4.0/4.1 and 5.1 states:
If you use
GROUP BY
[ forselect
], output rows are sorted according to theGROUP BY
columns as if you had anORDER BY
for the same columns. ➫➫➫
However, MySQL 5.5 states:
Relying on implicit
GROUP BY
sorting in MySQL 5.5 is deprecated. To achieve a specific sort order of grouped results, it is preferable to use an explicitORDER BY
clause. ➫➫➫
(The above info is also stated in 5.6 and 5.7.)
What exactly does "deprecated" mean in MySQL?
Is the behavior of implicit group by
still guaranteed to work on MySQL 5.5, 5.6, and 5.7 (the current latest version) just like in every single version before that?
Is ORDER BY NULL
still required to stop MySQL from doing needless sorting?
Edit (by Rick James)
This covers database issues:
- The ordering of a
GROUP BY
withoutORDER BY
- The meaning and usefulness of
ORDER BY NULL
- The wisdom of using a 'deprecated' 'feature'
- The meaning of "deprecated" in the MySQL manual (not just for this case)