Message-Id: <10514.107309@fatcity.com> From: Bruce Page Date: Wed, 31 May 2000 10:08:52 -0500 Subject: RE: SQL - Deleteing rows from a table-- Help!!! This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01BFCB12.49BE429E Content-Type: text/plain; charset="iso-8859-1" Try delete from accts t1 where exists (select 'x' from dup_accts t2 where t1.acct_id=t2.acct_id and t1.cust_id=t2.cust_id;) Try this in test first. -----Original Message----- From: DeSouza, Shaun [mailto:Shaun.DeSouza@CIBC.com] Sent: Wednesday, May 31, 2000 9:40 AM To: Multiple recipients of list ORACLE-L Subject: SQL - Deleteing rows from a table-- Help!!! I need to delete certain rows from a Table. To delete the rows I need to join to another table which contains the rows I need to delete. It is based upon the following SQL select: select * from accts t1, dup_accts t2 where t1.acct_id=t2.acct_id and t1.cust_id=t2.cust_id; I need to delete all the rows from the accts table which match to this join. I am really confused!!!! Can anyone help!!!!!! Shaun de Souza mailto:shaun.desouza@cibc.com Phone: 416.780.3295 Fax: 416.784.7581 -- Author: DeSouza, Shaun INET: Shaun.DeSouza@CIBC.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). ------_=_NextPart_001_01BFCB12.49BE429E Content-Type: text/html; charset="iso-8859-1" RE: SQL - Deleteing rows from a table-- Help!!!

Try
delete from accts t1
   where exists (select 'x'
       from dup_accts t2
          where t1.acct_id=t2.acct_id and
           t1.cust_id=t2.cust_id;)

Try this in test first.


-----Original Message-----
From: DeSouza, Shaun [mailto:Shaun.DeSouza@CIBC.com]
Sent: Wednesday, May 31, 2000 9:40 AM
To: Multiple recipients of list ORACLE-L
Subject: SQL - Deleteing rows from a table-- Help!!!


I need to delete certain rows from a Table. To delete the rows I need to
join to another table which contains the rows I need to delete. It is based
upon the following SQL select:

select *
from accts t1, dup_accts t2
where t1.acct_id=t2.acct_id and
           t1.cust_id=t2.cust_id;

I need to delete all the rows from the accts table which match to this join.
I am really confused!!!!
Can anyone help!!!!!!

Shaun de Souza
mailto:shaun.desouza@cibc.com
Phone: 416.780.3295
Fax: 416.784.7581


--
Author: DeSouza, Shaun
  INET: Shaun.DeSouza@CIBC.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).