Subject Re: [firebird-support] Re: How to insert only if a matching row does not exist?
Author Paul Vinkenoog
Hi Ed,

> > merge
> > into emp
> > using (select 'mango' fruits from rdb$database) src
> > on emp.fruits = src.fruits
> > when not matched then insert (fruits) values ('mango')
>
> Nice trick! That seems to work.

Just realized you can make it even easier:

merge
into emp
using rdb$database
on emp.fruits = 'mango'
when not matched then insert (fruits) values ('mango')

Cheers,
Paul