I have a table like below:
Check | Bill Total | D1 | D2 | D3 | D4 | D5 |
1 100 10 2 2 50 10 5 7
D1 – D5 stands for different discount type, how can I get to the following?
Check | Bill Total | Discount Type | Discount |
1 100 D1 10 1 100 D3 2 2 100 D1 10 2 100 D4 5 2 100 D5 7
Many Thanks.
Please check the example of unpivot: