In mySql how do I insert a row if no row exists for a particular email, I need to create a thousand missing rows from a database table, I have a file of five thousand emails I dont know which of the email is already in the table and which is not.
I tried to construct an sql statement for each row like this but it is invalid sql syntax
insert into License (email) select unique '[email protected]' where not exists (select 1 from License where email='[email protected]');
Email is not the primary key of the table and not neccessarily unique, all I am concerned about is if there is no record with the email address add a record otherwise do not.