Sqlite how delete last added entry of a table Sqlite how delete last added entry of a table sqlite sqlite

Sqlite how delete last added entry of a table


Try this

DELETE FROM notes WHERE id = (SELECT MAX(id) FROM notes);


delete from notes where created_at = ( select max(created_at) from notes );

Watch out, this will not limit the number of rows deleted. If there are more than one row at max(created_at), this will delete all of them because the subject you specified does not exist (last added entry of a table).