Created
May 5, 2011 06:53
-
-
Save MnO2/956653 to your computer and use it in GitHub Desktop.
SQLite Tricks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- insert a record if it doesn't exist, ignore if it does exist | |
-- if EventTypeName column is unique | |
INSERT OR IGNORE INTO EVENTTYPE (EventTypeName) VALUES 'ANI Received' | |
-- otherwise | |
INSERT INTO EVENTTYPE (EventTypeName) | |
SELECT 'ANI Received' | |
WHERE NOT EXISTS (SELECT 1 FROM EVENTTYPE WHERE EventTypeName = 'ANI Received'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment