user6454491 user6454491 - 1 year ago 63
SQL Question

SQL: How can I find Tuples with the same attribute?

I three Tables

Seller(ID, Name)

Product(ID, description, tax)

sells(SellerID, ProductID, price)

How do I find the sellers who sell the same product for the same price?

Answer Source

something like

select x.SellerID ,y.SellerID
from sells x
join sells y
on x.ProductID = y.ProductID
and x.price = y.price
and x.SellerID <> y.SellerID
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download