Я хочу свернуть данные SQL server (то есть столбец в виде строк и строки в виде столбца)
У меня есть данные следующим образом
CompanyName Year Sales TradedSales TotalSales Taxes NetSales RowMaterial TCS 2017 201 1245 65650 23 3232 323 TCS 2018 122 121 2121 121 21231 2121 Tata Moters 2015 14 54 54 545 456 4548 Tata Moters 2017 2121 12 21 156 565 5656 Tata Moters 2018 7512 5454 545 5454 787 78 SMERA 2017 5544 2121 545 9522 878 121 SMERA 2017 784 787 998 854 545 545 I want Output as CompanyName TCS TCS [Tata Moters] [Tata Moters] [Tata Moters] SMERA SMERA Year 2017 2018 2015 2017 2018 2017 2017 Sales 201 122 14 2121 7512 5544 784 TradedSales 1245 121 54 12 5454 2121 784 TotalSales 65650 21 21 54 21 545 998 Taxes 23 21 545 156 5454 9522 854 NetSales 3232 21231 456 565 787 878 121 RowMaterial 323 2121 4548 5656 78 121 545 also there are many companies data for many years so Want solution dynamic What I have tried: I dont have Idea About Pivot so Please provide solution for problem thanks in advance