oracle 行转列 使用PIVOT关键字

select * from (SELECT STOP_ID,POSITION,INSTANT,SET_VALUE from table1)pivot(
  min(INSTANT) I,min(SET_VALUE) V FOR POSITION IN(
    1 AS HT1,
    2 AS HT2,
    3 AS HT3,
    4 AS HT4,
    5 AS HT5,
    6 AS  HT1,
    7 AS  HT2
  )
)

posted @ 2023-05-09 09:51  韩小陌  阅读(39)  评论(0编辑  收藏  举报