RE: DUPLICATE ROWS.

  • From: "Karen Morton" <karen.morton@xxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 30 Jun 2004 19:28:35 -0700

Another way to find/remove duplicate rows is:

SELECT test_id
  FROM test t
 WHERE t.rowid >
  (SELECT MIN(t1.rowid)
     FROM test t1
    WHERE t.test_id=t1.test_id);

Then, if you wanted to get rid of the dups, just DELETE:
DELETE FROM test t
WHERE t.rowid >
  (SELECT MIN(t1.rowid)
     FROM test t1
    WHERE t.test_id=t1.test_id);

 
 
Karen Morton
Hotsos Enterprises, Ltd.
http://www.hotsos.com




-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Seema Singh
Sent: Thursday, July 01, 2004 6:22 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: DUPLICATE ROWS.


Here is
select count(test_id) from test;
shows 102 rows

select count(distinct(test_id) from test; shows 100 rows

How to find those 2 rows ?
I tried to run to find by using max rowid or min rowid but unable to.if
some 
one have quesry can pl send to me
thx


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: