Deleting specified number of rows from SQLite database Deleting specified number of rows from SQLite database sqlite sqlite

Deleting specified number of rows from SQLite database


DELETE FROM tblname WHERE `_id` IN (SELECT `_id` FROM tblname ORDER BY `_id` ASC LIMIT 6)

I think your problem may have been quoting the _id, though.


The LIMIT and ORDER options for DELETE in sqlite are optional, and it appears they aren't enabled on Android. Borealid's SQL above will work fine even without the quotes.