Re: real beginner PL/SQL question

From: N Prabhakar <prabhs_at_po.pacific.net.sg>
Date: 1996/11/12
Message-ID: <569pso$k6c_at_newton.pacific.net.sg>#1/1


ron.heeb_at_csun.edu (Ron Heeb) wrote:
>how do i delete rows that are in one table but not in the other? i.e.
>table A has id's of 1,2,3,4,7,8 and table B has 1,2,3,4,5,6,7,8; how do i
>identify and delete 5 and 6 based on not existing in table A? thanks in
>advance, ron
>
>--
>Ron Heeb, Webmaster
>Mgr., Applications Development, ITR
>California State University, Northridge
>email: ron.heeb_at_csun.edu, webmaster_at_csun.edu

Hi there,

Try the following statement.

DELETE FROM T2
WHERE NOT EXISTS (SELECT 'X' FROM T1

                  WHERE T1.ID = T2.ID )


Regards

N.Prabhakar
Socgen Crosby Securities,
Singapore Received on Tue Nov 12 1996 - 00:00:00 CET

Original text of this message