Skip to content
Advertisement

Create sql pivot on more row&column

I have to combine in PIVOT multiple columns / rows. let me explain with an example:

My start table:

How I wish:

My code only for PriceIT :

Result:

Advertisement

Answer

I am not sure how you are getting the data from the function call. Based on your requirement, I have created a table and inserted the datas which you have provided.

Based on your requirement I have pivoted the records each for IT, ES and AT.

Using the above query I am getting the desired output. Let me know if you have any issues with the understanding.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement