Data Changes
Delete Rows
Removing Matches
DELETE removes rows that match a condition.
Program
Play the script to remove completed queue items.
delete_rows.sql
CREATE TABLE queue (id INTEGER, task TEXT, done INTEGER);
INSERT INTO queue VALUES (1, 'ship', 1), (2, 'reply', 0), (3, 'archive', 1);
DELETE FROM queue WHERE done = 1;
SELECT id, task FROM queue ORDER BY id;
DELETE
`DELETE FROM queue` removes rows.
condition
`WHERE done = 1` protects rows that are not done.
remaining rows
The final table contains only rows that survived the delete.