Comments - ORDER BY before GROUP BY
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
As the GROUP BY article states, "If you select a non-grouped column or a value computed from a non-grouped column, it is undefined which row the returned value is taken from. This is not permitted if the
ONLY_FULL_GROUP_BY
SQL_MODE is used." So you can't guarantee the order. You however use a function such as MAX(info) to get a specific value.Since the text is unlikely to be sortable in that way, here's an extremely horrible hack that would work, assuming your ids increment:
Of course, you probably want to remove the id from the info field, so taking the hack further, and assuming the id length never exceeds 50:
THANKS!!! - It works!