[thelist] Finding NON-unique values in MS SQL

jcanfield at magisnetworks.com jcanfield at magisnetworks.com
Wed Jul 3 17:56:00 CDT 2002


> >I'm trying to come up with a query which would simply list
> all entries
> >which appear in any particular column more than once. I'm
> stumped. It
> >should be simple, I thought.
>
> Select ID From TableName WHERE
>   ID in (Select IDF from TableName)
>
> Select ID From TableName WHERE
>   ID in (Select IDT from TableName)

Wouldn't that just tell me if ID appeared in one of the other columns? I
need to know if any values are repeated in the IDF column, then I need to
know if any values are repeated in the IDT column.

Or perhaps I'm misunderstanding you; wouldn't be the first time.

joel



More information about the thelist mailing list