how to get the last id of table sql code example Example: sql get last ID SELECT MAX(id) FROM <tablename>