How do i transform the table of format based on the value in the “Col1”
Let the initial table content be
Col1 Col2 Cnt color
----------------------------
1 1 5 green
1 2 0 blue
1 3 7 red
2 1 0 gray
2 2 10 yellow
2 3 8 orange
INTO the table of following format
c11 d11 e11 color11 c12 d12 e12 color12 c13 d13 e13 color13
------------------------------------------- -----------------------
1 1 5 green 1 2 0 blue 1 3 7 red
2 1 0 gray 2 2 10 yellow 2 3 8 orange
the query is used to generate the data set for a report. where i plot the bubble chart for the each of the x,y co-ordinate.
” c11 d11 e11 c12 d12 e12 c13 d13 e13″ are the column names in the new dataset. Since the columns could vary dynamically i have quoted as this way.
I use the color to plot the color for each bubble value
Can some one please help in this query?
I don’t think a PIVOT solution is what you’re really after. Instead you can do the following
Which outputs this
My guess is that you’ll probably need to Dynamically Generate this sql in your solution rather than the static solution I have.