bslone12 Posted November 12, 2015 Share Posted November 12, 2015 can anyone help me with why this isn't working INSERT into shows (title) values ('{"en":"Criminal Minds"}' ) where not EXISTS ( SELECT title FROM shows WHERE title = '{"en":"Criminal Minds"}' ); I get this: MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where not EXISTS ( SELECT title FROM shows ' at line 3 Quote Link to comment Share on other sites More sharing options...
Barand Posted November 12, 2015 Share Posted November 12, 2015 INSERT statements don't have WHERE clauses. If you don't want to allow duplicate titles, add a UNIQUE constraint to the title column 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.