Is there a way in mysql to write a re-runnable sql script? I tried the : 'IF EXISTS' syntax but that only seems to work for stored procedures. It doesn't seem the 'select if' syntax will do what I want.
Ideally I would like to do something like:
IF NOT EXISTS (select * from table where name='Name') Then insert into table values('Name');
else select 'Name has already been inserted into table';
end if;
Thanks.