Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Select statement question ...

Re: SQL Select statement question ...

From: Martin Doherty <martin.doherty_at_elcaro.moc>
Date: Thu, 07 Nov 2002 22:52:51 -0800
Message-ID: <SeJy9.4$x86.354@news.oracle.com>


One way is with the NOT EXISTS predicate:

select *
from tableA
where not exists (select 'x' from tableB where tableB.key = tableA.key)

Yasuki Izaki wrote:

>I'm looking for a sample SQL statement to select KEY field from tableA
>where KEY field does not exist in tableB?
>Lets' say, there are 2 tables (tableA and tableB). Both tables has KEY
>column defined. I need to know the records which KEY does exist in the
>tableA but does not exist in the tableB. What's the way to do this?
>Please e-mail me your suggestions to yizaki_at_yacan.com
>Thank you in advance for your hellp.
>
>
Received on Fri Nov 08 2002 - 00:52:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US