Answers for "mysql find max value row"

SQL
2

mysql find max value row

SELECT t1.*
FROM employees t1
INNER JOIN (
    SELECT id, max(salary) AS salary FROM employees GROUP BY id
) t2 ON t1.id = t2.id AND t1.salary = t2.salary;
Posted by: Guest on April-22-2021
1

mysql get max value and id

SELECT a.id, a.rev, a.contents
FROM YourTable a
INNER JOIN (
    SELECT id, MAX(rev) rev
    FROM YourTable
    GROUP BY id
) b ON a.id = b.id AND a.rev = b.rev
Posted by: Guest on February-08-2021

Code answers related to "mysql find max value row"

Code answers related to "SQL"

Browse Popular Code Answers by Language