Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Change Column to Row

$
0
0

I have a table :

AA       AF       AF+AA Target    AF+AA  Booking

1         2               3                            4

5         6                  7                          8

Now I need to make this as:

Metric               Measure       MetriCode

AA(AO DP)            1                 02

AA(AO DP)            5                 02

AF                        2                08

AF                        6                08

AA(AO DP)             3               02

AA(AO DP)             7               02

AA(AO DP)             4               08

AA(AO DP)             8               08

I need to convert column into row with the "Metric" Name and all my values shouls be "Measure". Also Anything like AA with be AA(AO DP) and AF would be Authorized Futures. Also whatever change tp AA(AO Dp) I need to add metriccode ='08' and Authorized Future ='02'.

How can I get this result?


SPPandey



Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>