in reply to Re: MAX and GROUP BY in DBIx::Class
in thread MAX and GROUP BY in DBIx::Class
Update: sorry, I was confused by the third column and didn't read your new query properly.
Suffers the same problem: there is nothing in that query that tells the server that the name you want is the one from the max id row. Most RDBMS will give an error if you try it, including I'm pretty sure SQL Server.
That, plus your use of the term auto increment for what SQL Server calls an IDENTITY column, makes me think you are in fact using mysql or mariadb (without the ONLY_FULL_GROUP_BY sql_mode that prevents mistakes like your query, which is on by default in non ancient versions of mysql but sadly many old databases turn off).