codice:
SELECT MAX(id) AS max FROM tabella
e lo richiami come 'max'