Just order my_id and take only the first entry with limit 1
SELECT my_id, col2, col3 FROM mytable order by my_id desc limit 1
Another less effective way would be
SELECT my_id, col2, col3 FROM mytable where my_id = (select max(my_id) from mytable)
juergen d
source share