Subject Re: [firebird-support] What's wrong with this query?
Author Mark Rotteveel
I think you mean NOT EXISTS. That would be useful if the requirement is
that the email_address must be unique in the whole table (my
interpretation was that the combination fk_client_id and email_address
should be unique).

Svein Erling Tysvaer wrote:
> SELECT TE.EMAIL_ADDRESS
> FROM TEMP_EMAIL3 TE
> LEFT JOIN RECIPIENT R2 ON TE.EMAIL_ADDRESS = R2.EMAIL_ADDRESS
> AND R2.FK_CLIENT_ID = :A_CLIENT_ID
> WHERE R2.EMAIL_ADDRESS IS NULL
> AND EXISTS(SELECT * FROM RECIPIENT R
> WHERE TE.EMAIL_ADDRESS = R.EMAIL_ADDRESS)

--
Mark Rotteveel <Avalanche1979@...>