musicfreak1203,
Welcome to Bytes!
Your question is a bit vague, but I think I understand what you are asking.
The theoretical answer is that you will want to use a sub-query that finds all the comapnies that have those two products. However, as I have found in the past, finding a company that has "either" of those products is easy. Finding the company that has "both" is more challenging.
However, your query could look something like this:
- SELECT *
-
FROM tblCompanyProducts
-
WHERE Company IN (
-
SELECT Company
-
FROM tblCompanyProducts
-
WHERE Products = "Pencil")
-
AND Company IN (
-
SELECT Company
-
FROM tblCompanyProducts
-
WHERE Products = "Eraser")
-
ORDER BY Company, Products;
Hope this hepps!