Subject | Re: [firebird-support] Re: What's wrong with this query? |
---|---|
Author | Mark Rotteveel |
Post date | 2009-02-18T18:32:58Z |
vladman992000 wrote:
SELECT te.email_address
FROM temp_email3 te
LEFT JOIN recipient re ON te.email_address = re.email_address
WHERE re.fk_client_id = :A_CLIENT_ID
AND re.email_address IS NULL
You do have to make sure that temp_email3 only contains the addresses
for this client.
--
Mark Rotteveel <Avalanche1979@...>
> Thank you for the input. Basically I'm taking a table of emailOk, then this query probably works:
> addresses to be added to a list of recipients, and my goal is that the
> query should only add email addresses that don't already exist for the
> nominated client (A_CLIENT_ID) in the RECIPIENTS table already
> (basically avoiding duplicate entries).
>
> Hope that explains it a bit better.
SELECT te.email_address
FROM temp_email3 te
LEFT JOIN recipient re ON te.email_address = re.email_address
WHERE re.fk_client_id = :A_CLIENT_ID
AND re.email_address IS NULL
You do have to make sure that temp_email3 only contains the addresses
for this client.
--
Mark Rotteveel <Avalanche1979@...>