I have a customer transaction table that looks similar to this:
| Customer ID | Product Purchased |
|---|---|
| A | Red |
| B | Blue |
| A | Blue |
| C | Red |
| B | Blue |
It contains all transactions over a long time period I want to know which customers have bought just red, just blue and both red and blue, so a table like this:
| Customer ID | Product Purchased |
|---|---|
| A | Both |
| B | Blue only |
| C | Red only |
I've attempted a CASE WHEN statement, but it ends up duplicating the customer IDs But when I group by customer ID then I get an error saying the case statement isn't aggregating