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: Delete records

Re: Delete records

From: Neil Korning Andersen <nka_at_csc.dk>
Date: 1998/02/09
Message-ID: <01bd359e$b863e020$e3371d93@dhcpi3381.csc.dk>#1/1

Hi Casper
 Try this

delete from table1
where id not in
(select id from table2

     union
select id from table3)

Hope this helps
Neil
Casper Thrane <ct_at_infoaccess.dk> skrev i artiklen <34DF3C11.C9384677_at_infoaccess.dk>...
> Hi!
>
> I have got this problem.
> I have to delete all records from one table that doesn't exist in two
> other tables.
>
> table 1
> id
> 1
> 2
> 3
> 4
> 5
> 6
>
>
> table 2 table 3
> id id
> 2 5
> 3 6
>
> I want to delete all records from table 1 that has been left over, if
> you combine table 2 and table 3. This means in this case, that I want to
> delete id 1 and 4.
>
> Casper Thrane
>
Received on Mon Feb 09 1998 - 00:00:00 CST

Original text of this message

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