I have a schema like this
demo(month_year(navarchar), datecount(int), destination(nvarchar), type(nvarchar)).
In output i want to transform the rows to columns with concatenate columns.
datecount | Month_year | destination type
-------------------------+---------------+-------------------
07 | March - 18 | ABC No
23 | August - 2018 | ABC No
29 | August - 2018 | XYZ Sold Out
04 | July - 2018 | PQR Sold Out
10 | July - 2018 | XYZ No
25 | July - 2018 | ABC Sold Out
In the output i want,
Month_Year 1 2 3 ...
July - 2018 04(Sold Out-PQR) 10(No-XYZ) 25(Sold Out-ABC)
August - 2018 23(No-ABC) 29(Sold Out-XYZ)
I have tried more using the PIVOTE function. Facing the problem to display combination of datecount with destination and type as per above expected output. But could not get the solution. Please help me.