Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

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