Pivoting a table using Unique/Distinct Values
I have got data that looks like this table(I have simplified the table, but the idea is to get the number of unique product ids form unique columns and insert discount id where customer id meets product id, otherwise it will be a missing value(?)):
I would like to turn this into this form:
I have played around with the PIVOT operator but I am struggling to achieve this.
Thanks very much in advance!