I am newbie to Oracle but have worked on mysql previously. We have migrated the database from mysql to oracle and want help in this scenario.
I have table in the oracle 10g which is in the following format:
student_id student_key student_value
---------- ----------- -------------
1 name john
2 name bill
1 age 28
2 age 26
2 result pass
now i want to create a pivot on it so i use the following query:
select student_id, decode(student_key, 'name', student_Value, null) as studentName
from student_table
the output comes as
student_id studentName
---------- -----------
1 john
1 null
2 bill
2 null
2 null