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: Comparing between two tables

RE: Comparing between two tables

From: DENNIS WILLIAMS <DWILLIAMS_at_LIFETOUCH.COM>
Date: Wed, 15 Jan 2003 19:38:43 -0800
Message-ID: <F001.00530E66.20030115193843@fatcity.com>


David - If your tables aren't too large, you can do something like:

delete from table1
where col1 not in (select col1 from table2);

If you have many rows, you may want to use a variation on this to reduce the transaction size.

Like:
delete from table1
where col1 not in (select col1 from table2) and rownum < 1000; commit;
repeat until all rows are deleted.

Repeat until
Dennis Williams
DBA, 40%OCP
Lifetouch, Inc.
dwilliams_at_lifetouch.com

-----Original Message-----
Sent: Wednesday, January 15, 2003 7:04 PM To: Multiple recipients of list ORACLE-L

Is it a way to compare two tables to see the differences? We have problem with our database, someone input new data into database that causes problem, we want to find and remove those entries from that table.

Thanks,
David
--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Nguyen, David M
  INET: david.m.nguyen_at_xo.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: DENNIS WILLIAMS
  INET: DWILLIAMS_at_LIFETOUCH.COM
Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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). Received on Wed Jan 15 2003 - 21:38:43 CST

Original text of this message

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