| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
|  |  | |||
Home -> Community -> Usenet -> c.d.o.server -> Re: Delete records
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
|  |  |