Tuesday, 14 May 2013

How do I find duplicate values in a table in Oracle?

To find the simplest SQL statement that return the duplicate values for a given column and the count of their occurrences in an Oracle database table, see below
SELECT table_field, COUNT(table_field) AS dup_count
FROM table_name
GROUP BY table_field
HAVING (COUNT(table_field) > 1);
it will retrieve the feildID and it's duplication count.

No comments:

Post a Comment