I am trying to feed a data visualization program which uses sql queries. In order to create a pie chart, it wants the input to look as follows:
+--+-----+-----+-----+
|SliceName|SliceValue
+--+-----+-----+-----+
|Slice 1 |1
+--+-----+-----+-----+
|Slice 2 |5
+--+-----+-----+-----+
Our product data is stored in a table like this:
+--+-----+-----+-----+
|ProductID|Slice 1 | Slice 2
+--+-----+-----+-----+
|123 |1 |5
+--+-----+-----+-----+
Additional products being stored on additional rows. We need to retrieve one of these rows using the ProductID, then create sql output which looks like the table in the first example. I have read some posts about "pivoting", but I'm not sure that is exactly what we need to do here.
Can anyone offer some pointers?