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 -> Request help from SQL Gurus

Request help from SQL Gurus

From: <gthorne777_at_my-deja.com>
Date: Thu, 27 May 1999 20:31:21 GMT
Message-ID: <7ika2p$86l$1@nnrp1.deja.com>


Hi, we are running RDB7. I'm not an SQL expert by any means, so I need help with this statement. I have two tables. We'll call them TABLE1 and TABLE2 for this example. I have rows in both tables that I want to delete based on a condition in TABLE1. For exaple, let's say TABLE1 has the following rows:

                    DATE      INTEGER
                    BATCH_ID  INTEGER
                    DEST      CHAR(8)

and TABLE2 has the following rows:
                    BATCH_ID  INTEGER
                    DEST      CHAR(8)
                    NAME      CHAR(25)
                    ADDR      CHAR(50)
                    ZIP      CHAR(50)
                    PHONE    CHAR(15)

I want to delete the records in TABLE1 before a certain date, and also delete the records in TABLE2 that have a corresponding BATCH_ID and DEST. What would be the easiest way to do this? I'm re-writing a program that did it by doing a SELECT statement on the first table, parsing the output, and deleting the corresponding records in TABLE2. I think there has to be a better way.

                      -Greg



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu May 27 1999 - 15:31:21 CDT

Original text of this message

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