Maximum id of a table

select max(columnname) from tablename;