Oracle
 sql >> Base de données >  >> RDS >> Oracle

Transposition de ligne de colonne dans Oracle Sql

WITH t AS
     (SELECT 1001 studentid, 'john' NAME FROM dual
     UNION ALL
     SELECT 1002, 'kane' FROM dual
     )
SELECT * FROM (
SELECT studentid, NAME FROM t)
pivot (max(studentid) for name in ('john' John, 'kane' Kane));