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