I want to ONLY select customers who have purchased both products 22 and 36
Customers
Id | Name | |
---|---|---|
1 | [email protected] | Jack |
2 | [email protected] | Robin |
3 | [email protected] | Pop |
Sales
Id | CustId | ProdId | Amount |
---|---|---|---|
1 | 1 | 22 | 100 |
2 | 2 | 22 | 100 |
3 | 2 | 36 | 120 |
4 | 2 | 45 | 150 |
5 | 3 | 36 | 120 |
6 | 3 | 45 | 180 |
2
Answers
You can display the data you want by joining two tables and specifying the desired product IDs. The following expression provides this.
You can use query as follow