Oracle
 sql >> Database >  >> RDS >> Oracle

Oracle PIVOT, due volte?

Da oracle-developer.net sembrerebbe che si possa fare così:

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)
            )