Home
NOTE: I'm in the middle of upgrading the site. Most things are in place, but some things are missing and/or broken. This includes alt text for images. Please bear with me while I get things fixed.

Insert Or Ignore In SQLite

CREATE TABLE example_table(example_item TEXT UNIQUE);

Then do this :

INSERT OR IGNORE 
INTO example_table(example_item) 
VALUES("alfa bravo");

Note that with this approach an AUTOINCREMENT counter increases even if a row isn't inserted. If that bugs you, you can either not use AUTOINCREMENT (e.g. use the generic ROWID) or use a different approach.

~ fin ~

References