On 25/05/18 14:35, Igor Neyman wrote:
>
> '''INSERT INTO my_table(name, age)
>
> VALUES( %s, %s)
>
> WHERE NOT EXISTS(SELECT name FROM my_table WHERE name=%s)''', ('Scott',
> 23, 'Scott'))
I haven't been following this thread, so maybe this has already been
said, but I think you need a SELECT in there as well:
insert into my_table(name, age)
select 'value 1', 'value 2'
where not exists (
.....
);
Ray.
--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie