Find Duplicate Values in a Table

There are several reasons that you may want to find duplicate values in a table. The main reason is when you are attempting to build a unique index on a field and the index build crashes with a SQL duplicate value error. This error message does not go far enough in that it tells you it has a problem, but it does not tell you where the duplicate value occurs. All that you know is that you have a duplicate value somewhere.

There are several approaches to solving this problem, and one good method for avoiding it. If you initially build the table with a unique index on the field in question, you will avoid the duplicates in the first place. This requires planning ahead. You have to know in advance that you want field ...

Get Informix DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.