Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql group select max value of group by

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #group #select #max #group
ADD COMMENT
Topic
Name
6+8 =