Oracle pivot operator

前端 未结 2 1243
花落未央
花落未央 2020-12-04 01:12

I am new to oracle pivot. Is this possible?

I have two columns Type and Value

type     value
---------------
a        a1
b          


        
2条回答
  •  星月不相逢
    2020-12-04 01:39

    Something like this:

    SELECT a, b, c
      FROM tbl
     PIVOT
     (
       MAX(Value) FOR Type IN ('a' as a, 
                               'b' as b, 
                               'c' as c)
     )
    

    For more details you can refer to this documentation.

提交回复
热议问题