【问题标题】:Transposed table redshift转置表红移
【发布时间】:2017-03-16 15:17:36
【问题描述】:

我想将列转置为行(不使用 UNION):

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

进入:

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

小节的数量是固定的。

我正在使用 Amazon Redshift。

【问题讨论】:

    标签: amazon-redshift


    【解决方案1】:

    您需要为此使用 Union。你为什么不想使用它?没有其他办法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-28
      • 1970-01-01
      • 2019-01-08
      • 2023-03-13
      • 1970-01-01
      • 2023-03-15
      • 1970-01-01
      • 2018-06-10
      相关资源
      最近更新 更多