Se hai un id fai cosi':

SELECT id FROM tabella ORDER BY id DESC LIMIT 1