Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql group select max value of group by

SELECT t1.*
FROM yourTable t1
INNER JOIN
(
    SELECT `Group`, MAX(Age) AS max_age
    FROM yourTable
    GROUP BY `Group`
) t2
    ON t1.`Group` = t2.`Group` AND t1.Age = t2.max_age;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #group #select #max #group
ADD COMMENT
Topic
Name
1+6 =