0
votes

I want to transpose columns into rows (without using UNION):

|Dimension1 | Measure1 | Measure2 |
-----------------------------------
|     1     |   x1     |  y1      |
|     0     |   x2     |  y2      |

Into:

   | Dimension1 |  Measures |  Values |
   -----------------------------------
   | 1          |  Measure1 |    x1   |
   | 1          |  Measure2 |    y1   |
   | 0          |  Measure1 |    x2   |
   | 0          |  Measure2 |    y2   |

The number of the measure is fixed.

I'm using Amazon Redshift.

1

1 Answers

1
votes

You need to use Union for that. Why don't you want to use it ? There is no other way.