Re: Duplicate value
Posted in 1998
Priti Jhaveri wrote:
>
> Hi All,
> We are using 7.11 UC2 on NCR 2.03.UNIX.Hi All,
>
> When we try to do dbaccess-Table-Info-cOnstraints-Reference-referenceD for one
> of our tables it displays error message.
>
> ISAM error: duplicate value for a record with unique key.>
> Considering the following scenario, How can I find the duplicate records ?
>
> Table tab1 Primary key pk1 and
> Tables tab2, tab3, tab4 tab5 ... tab10 foreign key fk1 references to pk1
> table1.
>
> Thank you very much for your help.
>
> Regards
> Priti
>
Select col1, col2, col2, colN, count(*) (columns listed in primary key
)
from table
group by 1, 2, 3, N
having count(*) > 1
order by 1, 2, 3, N
This will isolate the primary key combination that is in violation of
the uniqueness constraints.
John Carlson
Informix DBA
WH Smith, Inc.