咸鱼达
2020-07-07 17:46
采纳率: 100%
浏览 338

Oracle转到PostGreSQL用什么取代UNPIVOT?

代码如下

UNPIVOT(
                    AA 
                    FOR SJ 
                    IN(I1,
                                                                                                                                                                                                                                                                                    I2,
                                                                                                                                                                                                                                                                                I3,
                                                                                                                                                                                                                                                                                I4,
                                                                                                                                                                                                                                                                                I5,
                                                                                                                                                                                                                                                                                I6,
                                                                                                                                                                                                                                                                                I7,
                                                                                                                                                                                                                                                                                I8,
                                                                                                                                                                                                                                                                                I9,
                                                                                                                                                                                                                                                                                I10,
                                                                                                                                                                                                                                                                                I11,
                                                                                                                                                                                                                                                                                I12,
                                                                                                                                                                                                                                                                                I13,
                                                                                                                                                                                                                                                                                I14,
                                                                                                                                                                                                                                                                                I15,
                                                                                                                                                                                                                                                                                I16,
                                                                                                                                                                                                                                                                                I17,
                                                                                                                                                                                                                                                                                I18,
                                                                                                                                                                                                                                                                                I19,
                                                                                                                                                                                                                                                                                I20,
                                                                                                                                                                                                                                                                                I21,
                                                                                                                                                                                                                                                                                I22,
                                                                                                                                                                                                                                                                                I23,
                                                                                                                                                                                                                                                                                I24,
                                                                                                                                                                                                                                                                                I25,
                                                                                                                                                                                                                                                                                I26,
                                                                                                                                                                                                                                                                                I27,
                                                                                                                                                                                                                                                                                I28,
                                                                                                                                                                                                                                                                                I29,
                                                                                                                                                                                                                                                                                I30,
                                                                                                                                                                                                                                                                                I31,
                                                                                                                                                                                                                                                                                I32,
                                                                                                                                                                                                                                                                                I33,
                                                                                                                                                                                                                                                                                I34,
                                                                                                                                                                                                                                                                                I35,
                                                                                                                                                                                                                                                                                I36,
                                                                                                                                                                                                                                                                                I37,
                                                                                                                                                                                                                                                                                I38,
                                                                                                                                                                                                                                                                                I39,
                                                                                                                                                                                                                                                                                I40,
                                                                                                                                                                                                                                                                                I41,
                                                                                                                                                                                                                                                                                I42,
                                                                                                                                                                                                                                                                                I43,
                                                                                                                                                                                                                                                                                I44,
                                                                                                                                                                                                                                                                                I45,
                                                                                                                                                                                                                                                                                I46,
                                                                                                                                                                                                                                                                                I47,
                                                                                                                                                                                                                                                                                I48,
                                                                                                                                                                                                                                                                                I49,
                                                                                                                                                                                                                                                                                I50,
                                                                                                                                                                                                                                                                                I51,
                                                                                                                                                                                                                                                                                I52,
                                                                                                                                                                                                                                                                                I53,
                                                                                                                                                                                                                                                                                I54,
                                                                                                                                                                                                                                                                                I55,
                                                                                                                                                                                                                                                                                I56,
                                                                                                                                                                                                                                                                                I57,
                                                                                                                                                                                                                                                                                I58,
                                                                                                                                                                                                                                                                                I59,
                                                                                                                                                                                                                                                                                I60,
                                                                                                                                                                                                                                                                                I61,
                                                                                                                                                                                                                                                                                I62,
                                                                                                                                                                                                                                                                                I63,
                                                                                                                                                                                                                                                                                I64,
                                                                                                                                                                                                                                                                                I65,
                                                                                                                                                                                                                                                                                I66,
                                                                                                                                                                                                                                                                                I67,
                                                                                                                                                                                                                                                                                I68,
                                                                                                                                                                                                                                                                                I69,
                                                                                                                                                                                                                                                                                I70,
                                                                                                                                                                                                                                                                                I71,
                                                                                                                                                                                                                                                                                I72,
                                                                                                                                                                                                                                                                                I73,
                                                                                                                                                                                                                                                                                I74,
                                                                                                                                                                                                                                                                                I75,
                                                                                                                                                                                                                                                                                I76,
                                                                                                                                                                                                                                                                                I77,
                                                                                                                                                                                                                                                                                I78,
                                                                                                                                                                                                                                                                                I79,
                                                                                                                                                                                                                                                                                I80,
                                                                                                                                                                                                                                                                                I81,
                                                                                                                                                                                                                                                                                I82,
                                                                                                                                                                                                                                                                                I83,
                                                                                                                                                                                                                                                                                I84,
                                                                                                                                                                                                                                                                                I85,
                                                                                                                                                                                                                                                                                I86,
                                                                                                                                                                                                                                                                                I87,
                                                                                                                                                                                                                                                                                I88,
                                                                                                                                                                                                                                                                                I89,
                                                                                                                                                                                                                                                                                I90,
                                                                                                                                                                                                                                                                                I91,
                                                                                                                                                                                                                                                                                I92,
                                                                                                                                                                                                                                                                                I93,
                                                                                                                                                                                                                                                                                I94,
                                                                                                                                                                                                                                                                                I95,
                                                                                                                                                                                                                                                                                I96))

pgSQL里面没有UNPIVOT函数,需要怎么修改才能达到同样的效果

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题