Created
October 15, 2014 17:23
Revisions
-
mattvryan created this gist
Oct 15, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ INSERT INTO my_table (unique_but_non_indexed_col1, col2, col3) SELECT * FROM (SELECT 'unique_val1', 'val2', 'val3') AS tmp WHERE NOT EXISTS ( SELECT id FROM my_table WHERE unique_but_non_indexed_col1='unique_val1' ) LIMIT 1;