I thought this would be a straightforward query to write, but it’s proving to be much trickier to achieve than I first thought.
Any help would be much appreciated – it’s driving me up the wall 🙂
I have two tables, one USERS the second; PURCHASED PRODUCTS. A user can have multiple products in the PRODUCTS table.
I have a joined query where I return a list of users that have a specific product – so far so good.
Now here’s the problem:
I want to exclude USERS that have another specific product.
Therefore, only return users that have product 1001, NOT users that have both products 1001 AND 1002 in the PRODUCTS table.
A slightly different approach: