How to transpose the data from rows to multiple columns dynamically in SQL Server?
Asked
Active
Viewed 75 times
0

marc_s
- 732,580
- 175
- 1,330
- 1,459

Madhusudhana
- 3
- 3
-
2What have you tried? Stack Overflow is not "write my code from scratch for me as a service"... maybe [start with an example like this](https://www.mssqltips.com/sqlservertip/2783/script-to-create-dynamic-pivot-queries-in-sql-server/), and then cater it to your table and columns. If you have trouble, bring *specific* technical problems back here. – Aaron Bertrand Nov 12 '18 at 17:51
-
1And when you do, please enter your sample data and desired results *as text*, not as screenshots of Excel. Your goal should be to make it as easy as possible for people to help you, which includes being able to copy your sample data, not type it out manually. – Aaron Bertrand Nov 12 '18 at 17:59
-
1Possible duplicate of [SQL Server dynamic PIVOT query?](https://stackoverflow.com/questions/10404348/sql-server-dynamic-pivot-query) – rs. Nov 12 '18 at 19:37