Jason Engel wrote:
WHY DOES IT NOT RETURN (pulls hair out!)
max(id) : title
1) 4 : title4
You're applying the DWIM ("Do What I Mean") principle.
The MAX() aggregate function does not return the row on which the max
value occurs. It only returns one value -- the maximum value found in
*one* column, within the group. When you list other columns in the
select-list, the row from which to take the value is ambiguous. In some
RDBMS products, it's actually an error to list a column in the
select-list that you haven't also listed in the GROUP BY clause. MySQL
is a bit more permissive, but it does to resolve the ambiguity in what
is called a "vendor-dependent" way.
Regards,
Bill K.