[thelist] Finding NON-unique values in MS SQL

Joel Canfield joel at spinhead.com
Wed Jul 3 16:56:01 CDT 2002


I have a table with three columns, ID, IDF, and IDT. All are integers. No
number should be repeated in any particular column, although a number could
conceivably appear in both IDF and IDT. I've added unique constraints, but
if I recall correctly, when we realized that uniqueness was required,
someone foolishly decided to add the constraint with no check on the
existing data.

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.

Thanks.

joel



More information about the thelist mailing list