A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

How to delete duplicate records in sql?

Best Answers

For this example, we will use the following table with duplicate PK values. In this table the primary key is the two columns (col1, col2). We cannot create a unique index or PRIMARY KEY constraint since two rows have duplicate PKs. This procedure illustrates how to identify and remove the duplicates. read more

Removing duplicate rows from the table without a unique index is a little easier in Oracle than in SQL Server. There is a ROWID pseudo column in Oracle which returns the address of the row. It uniquely identifies the row in the table (usually in the database also, but in this case there is an exception - if different tables store data in the same cluster they can have the same ROWID). read more

Related Types

Image Answers