问题
I can't figure out how to remove the very top row of a table in SQLite. I have the table populated and I just want to remove off the top of the table to work my way down.
Here is what I assume would've worked, but did not.
DELETE FROM images WHERE rowid <= 1
DELETE FROM images LIMIT 1
Any help would be greatly appreciated.
回答1:
SQLite DELETE Query is used to delete the existing records from a table. You can use WHERE clause with DELETE query to delete the selected rows. otherwise, all the records would be deleted.
If you need to delete the top rows on SQLite this query is a simple way, But there were multiple records more than 1000 make sure the query getting actual records
DELETE FROM images WHERE rowid in (select rowid FROM images LIMIT 1)
来源:https://stackoverflow.com/questions/53645627/removing-the-top-row-of-a-table-in-sqlite