Answers for "mysql get max value and id"

SQL
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 "SQL"

Browse Popular Code Answers by Language