Given the following table \'foo
\'
ID | First Name | Last Name
----------------------------
67 John Smith
----------------------------
6
MySQLs group by is not consistent with the standard SQL behaviour , MySQL makes it easy to get other columns BUT at the same time u can never be sure which one u will get.
True. Actually it corresponds more to SELECT DISTINCT ON mode in postgres for instance, except this allows you to specify the order of the rows prior to distinctization (?) and therefore which row you will get (ie most recent, oldest, whatever).
Note MySQL in "sql compliant" mode will reject GROUP BY with nonspecified columns as in your example.