Sample Header Ad - 728x90

Transposing a row data in multiple rows based on multiple columns

1 vote
1 answer
40 views
I have data in the database in the below format enter image description here And I want output data in this format
BudgetCategoryId | CostCenterDepartmentId | CostCenter | AccountNo | Amount    | Timestamp
714		         | 135	                  |  12010194  |       110 | 102000.00 | 01-01-2020
enter image description here Basically **timestamp** in the desired result is '01-' + + I tried transposing, pivot, unpivot but unfortunately unable to get the desired result. Column Names: Id | BudgetCategoryId | CostCenterDepartmentId | Year | AccountNo | CostCenter | Month1 | Month2 | Month3 | Month4 | Month5 | Month6 | Month7 | Month8 | Month9 | Month10 | Month11 | Month12 | Budget PS: I am very new in SQL (RDBMS)
Asked by Mayur Agarwal (111 rep)
Apr 18, 2020, 11:44 AM
Last activity: Apr 18, 2020, 02:58 PM