user6454491 user6454491 - 1 month ago 5x
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?


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