I have 3 table by this names
Supplier :For store supplier info
SupplierID | Name |
---|---|
1 | Supplier 1 |
2 | Supplier 2 |
3 | Supplier 3 |
4 | Supplier 4 |
Product : For store product info
ProductID | Name |
---|---|
1 | Product 1 |
2 | Product 2 |
3 | Product 3 |
4 | Product 4 |
5 | Product 5 |
SupplierProduct : For store Product that supplier can supply
ProductID | SupplierID |
---|---|
2 | 1 |
3 | 1 |
4 | 1 |
2 | 2 |
3 | 2 |
4 | 2 |
3 | 3 |
4 | 3 |
1 | 4 |
2 | 4 |
4 | 4 |
I want to write a query that get a bunch of product ID and return the supplier ID that have all this product ID (N:N Relation) for example get product ID 2,3 and return just supplier ID 1,2