Home All Groups Group Topic Archive Search About

finding duplicates of muliple fields combined

Author
8 Jul 2005 10:10 PM
et
I want to put a constraint on a table where a combination of fields are
unique, but there are already duplicates.

For instance,
    select distinct F1, F2, F3 from tbl  = 405 records, but there are 406
records in the
entire table.  F1 is a unique identifier by the way.

How can I find that duplicate?

Author
8 Jul 2005 10:47 PM
Thomas Coleman
Try:

Select F1, F2, F3
From tbl
Group By F1, F2, F3
Having Count(*) > 1



Thomas

Show quote
"et" <eagletender2***@yahoo.com> wrote in message
news:uN$RTnAhFHA.3616@TK2MSFTNGP12.phx.gbl...
>I want to put a constraint on a table where a combination of fields are unique,
>but there are already duplicates.
>
> For instance,
>    select distinct F1, F2, F3 from tbl  = 405 records, but there are 406
> records in the
> entire table.  F1 is a unique identifier by the way.
>
> How can I find that duplicate?
>
>
>

AddThis Social Bookmark Button