Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Difficult SQL Query
select attribute1 from Table1
minus
select attribute2 from Table2;
or
select attribute1 from table1
where
attribute1 not in
(
select attribute2 from Table2
);
or
select attribute1 from table1 T1
where
not exists
(
select 1 from Table2
where
attribute2= T1.attribute1
);
James Bourne wrote:
> All,
>
> I am having a problem getting a query to work:
>
> I have two tables where I want to find the difference
> between the two:
>
> Table1
> Attribute1 Number(8)
>
> Table2
> Attribute1 Number(8)
>
> I want to select all Table1.Attribute1 where
> Table1.Attribute does not exist in Table2
>
> How can I do this?
>
> ---------------------------------------------
> James Bourne
> TAPS Development
> Telstra Multimedia Pty. Ltd.
> Phone: 02 9903 3435
> EMail: jbourne_at_nibupls1.telstra.comdotau
> (pls. replace dot with . to email me)
Received on Tue Sep 16 1997 - 00:00:00 CDT
![]() |
![]() |