Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL - Deleteing rows from a table-- Help!!!

RE: SQL - Deleteing rows from a table-- Help!!!

From: Bruce Page <bpage_at_kimball.com>
Date: Wed, 31 May 2000 10:08:52 -0500
Message-Id: <10514.107309@fatcity.com>


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_at_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_at_cibc.com
Phone: 416.780.3295
Fax: 416.784.7581

-- 
Author: DeSouza, Shaun
  INET: Shaun.DeSouza_at_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_at_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"


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>RE: SQL - Deleteing rows from a table-- Help!!!</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Try </FONT>
<BR><FONT SIZE=2>delete from accts t1</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; where exists (select 'x'</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from dup_accts t2</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where t1.acct_id=t2.acct_id and </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t1.cust_id=t2.cust_id;)</FONT>
</P>

<P><FONT SIZE=2>Try this in test first.</FONT>
</P>
<BR>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: DeSouza, Shaun [<A HREF="mailto:Shaun.DeSouza_at_CIBC.com">mailto:Shaun.DeSouza_at_CIBC.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Wednesday, May 31, 2000 9:40 AM</FONT>
<BR><FONT SIZE=2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=2>Subject: SQL - Deleteing rows from a table-- Help!!!</FONT>
</P>
<BR>

<P><FONT SIZE=2>I need to delete certain rows from a Table. To delete the rows I need to</FONT>
<BR><FONT SIZE=2>join to another table which contains the rows I need to delete. It is based</FONT>
<BR><FONT SIZE=2>upon the following SQL select:</FONT>
</P>

<P><FONT SIZE=2>select * </FONT>
<BR><FONT SIZE=2>from accts t1, dup_accts t2</FONT>
<BR><FONT SIZE=2>where t1.acct_id=t2.acct_id and </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t1.cust_id=t2.cust_id;</FONT>
</P>

<P><FONT SIZE=2>I need to delete all the rows from the accts table which match to this join.</FONT>
<BR><FONT SIZE=2>I am really confused!!!!</FONT>
<BR><FONT SIZE=2>Can anyone help!!!!!!</FONT>
</P>

<P><FONT SIZE=2>Shaun de Souza</FONT>
<BR><FONT SIZE=2><A HREF="mailto:shaun.desouza_at_cibc.com">mailto:shaun.desouza_at_cibc.com</A></FONT>
<BR><FONT SIZE=2>Phone: 416.780.3295</FONT>
<BR><FONT SIZE=2>Fax: 416.784.7581</FONT>
</P>
<BR>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Author: DeSouza, Shaun</FONT>
<BR><FONT SIZE=2>&nbsp; INET: Shaun.DeSouza_at_CIBC.com</FONT>
</P>

<P><FONT SIZE=2>Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=2>San Diego, California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet access / Mailing Lists</FONT>
<BR><FONT SIZE=2>--------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>To REMOVE yourself from this mailing list, send an E-Mail message</FONT>
<BR><FONT SIZE=2>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in</FONT>
<BR><FONT SIZE=2>the message BODY, include a line containing: UNSUB ORACLE-L</FONT>
<BR><FONT SIZE=2>(or the name of mailing list you want to be removed from).&nbsp; You may</FONT>
<BR><FONT SIZE=2>also send the HELP command for other information (like subscribing).</FONT>
Received on Wed May 31 2000 - 10:08:52 CDT

Original text of this message

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