Wednesday, April 11, 2012

Find Duplicate records (Unique Index columns) in all Tables

SELECT 'SELECT COUNT(*),' || wm_concat(column_name) || ' from ' ||table_name || ' group by ' || wm_concat(column_name) || ' having count(*)>1;'
FROM user_ind_columns where index_name in (select index_name from user_indexes where uniqueness='UNIQUE')
GROUP BY index_name,table_name;


No comments:

Post a Comment

Followers