SQL statements for querying and deleting duplicate records reprinted from: HTTP://WWW.CNBLOGS.COM/252E/ARCHIVE/2012/09/13/2682817.HTML1, redundant duplicate records in lookup tables, Duplicate records are based on a single field (ID) to determine select * from table where Id in (select ID from table group Byid have count (id) > 1) 2, delete redundant duplicates in table Records, duplicate records are judged by a single field (ID), leaving only the rowid smallest record delete from table WHERE (ID) in (SELECT ID from table GROUP by Id has COUNT (ID) > 1) and ROWID not in (SELECT MIN (ROWID) from table GROUP by ID have COUNT (*) > 1); 3, redundant duplicate records in lookup table (multiple fields) select * From Table A where (A.ID,A.SEQ) in (Select Id,seq from table group by ID,SEQ have count (*) > 1) 4, delete redundant duplicate records (multiple fields) in the table, leaving only RO WID minimum record delete from Table A where (A.ID,A.SEQ) in (Select Id,seq from table group by ID,SEQ have count (*) > 1) and Rowi D Not in (select min (rowid) from table group by ID,SEQ have Count (*) >1) 5, redundant duplicate records in lookup table (multiple fields), with no rowid minimum records sele CT * FROM Table A WHERE (A.ID,A.SEQ) in (Select Id,seq from table group by ID,SEQ have count (*) > 1) and rowID not in (select Min (rowid) from table group by ID,SEQ have count (*) >1)
Oracle deletes duplicate data only one line