Question and answer is powered by AnsPress.io
how to select row with maximum value on a column in mysqli using PHP.
All you need is a GROUP BY
clause with the MAX
aggregate function:
SELECT id, MAX(rev) FROM YourTable GROUP BY id