Link to home
Start Free TrialLog in
Avatar of bobinorlando
bobinorlando

asked on

Find rows where one column has multiple matching values in another column

Experts,

I have a products table in our MS SQL Server db.

ID, productID, productname, catalogID

The business rule we are going to start using says that each catalogID can have one and only one matching productID.

One productID can have the same catalogID, but not the other way around.

Eventually we will create separate tables with foreign keys, but for now all the columns are in the same table.

How would I find those catalogIds that have more than one matching productId?

For some reason I can't get my head around this.

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bobinorlando
bobinorlando

ASKER

That did the trick! Thank you!!