Find Duplicate values in a table
Create table sql : CREATE TABLE ABC ( ID NUMBER , NAME VARCHAR2(20 BYTE) ) ; Lets insert duplicate values into it: INSERT INTO ABC (ID, NAME) VALUES ('15', 'f'); INSERT INTO ABC (ID, NAME) VALUES ('15', 'f'); INSERT INTO ABC (ID, NAME) VALUES ('15', 'f'); INSERT INTO ABC (ID, NAME) VALUES ('11', 'B'); INSERT INTO ABC (ID, NAME) VALUES ('11', 'B'); INSERT INTO ABC (ID, NAME) VALUES ('13', 'G'); INSERT INTO ABC (ID, NAME) VALUES ('13', 'G'); Now table looks like this: Now we have a duplicate combination of 2 columns. sql to find duplicate values combination in two columns: select ID,NAME, count(ID) from ABC group by ID,NAME having count(ID) > 1; sample output: Find the duplicate ID's in a column : select ID, count(ID) from ABC group by ID having count(ID) > 1; Sample output: Retrieving duplicate values