I wasn't sure if anyone on this forum had any experience with SQL and I have found this forum users to be extremely knowledgeable so I figured I would try and ask anyway.
I have a data table that lists customers and contains a row for every product the customer has. So a customer can have one row if they only have one product but can have 3 rows if they have three distinct products.
ex.
Customer Name PRODID
Customer 1 20200B
Customer 1 20700A
Customer 1 304Z
Customer 2 20200B
Customer 2 20700A
Customer 3 304Z
I am trying to add an "AND" condition to my "Where" clause that will have the query list the customer rows where customers have product 1, 2 and 3. If a customer has only one of those products or any other combination I don't want to see them. I only want to see that combination only. In the example above, I would only expect Customer 1 to populate.
I tried writing the "AND" condition to say .... "and (P1.PRODID in (20200B,20700A) and (P1.PRODID = '304Z')) but no rows generate.
Is anyone able to assist and advise what I may be doing wrong?
Bookmarks