Get records with max value for each group of grouped SQL results
The correct solution is: SELECT o.* FROM `Persons` o # ‘o’ from ‘oldest person in group’ LEFT JOIN `Persons` b # ‘b’ from ‘bigger age’ ON o.Group = b.Group AND o.Age < b.Age WHERE b.Age is NULL # bigger age not found How it works: It matches each row from o with all the rows … Read more