How can I select the row with the highest ID in MySQL?

Issue

How can I select the row with the highest ID in MySQL? This is my current code:

SELECT * FROM permlog WHERE max(id)

Errors come up, can someone help me?

Solution

SELECT * FROM permlog ORDER BY id DESC LIMIT 0, 1

Answered By – badbod99

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published