Re: help with select statement

From: Gerard H. Pille <ghp_at_skynet.be>
Date: Fri, 16 Jan 2009 20:41:04 +0100
Message-ID: <4970e2cf$0$2858$ba620e4c_at_news.skynet.be>



wibni schreef:
> Hi,
>
> I've got the following SQL statement and it is working almost fine.
>
> select distinct cscontact.name, relkeyword.swcode from cscontact,
> relkeyword where cscontact.pubindex = relkeyword.relpubindex(+) AND
> (relkeyword.swcode <> 173 OR relkeyword.swcode IS NULL) order by
> cscontact.name
>
> I want to leave out a contact completely as soon as it has keyword 173
> assigned to it.
> Any ideas on how to achieve that?
>

select distinct cscontact.name from cscontact   where not exists (
    select null

      from relkeyword
      where cscontact.pubindex = relkeyword.relpubindex
        AND relkeyword.swcode = 173

    )
order by cscontact.name Received on Fri Jan 16 2009 - 13:41:04 CST

Original text of this message