Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Oracle PIVOT, duas vezes?


De oracle-developer.net parece que pode ser feito assim:
SELECT somethingId, splitId1, splitName1, splitId2, splitName2
FROM (SELECT somethingId, splitId
      FROM SOMETHING JOIN SPLIT ON ... )
      PIVOT ( MAX(splitId)  ,
              MAX(splitName) 
              FOR displayOrder IN (1 AS splitName1, 2 as splitName2)
            )