I have to show id, type and value (in three different columns) in single row for each id from the table having id, name and vale as columns as below.
Original table
ID NAME VALUE
1 Effort 10
1 Type Development
2 Type Testing
2 Effort 20
3 Type Testing
3 Effort 20
Expected:
ID TYPE VALUE
1 Development 10
2 Testing 20
3 Testing 20
And following is the query i used to achieve the expected result:
select id as id,
case name when 'Type' then value else null end as TYPE,
case name when 'Effort' then value else null end as value
from tmn;
But I am getting a slightly different result form my expected one as:
ID TYPE VALUE
1 10
1 Development
2 Testing
2 20
3 Testing
3 20
Mates, As i mentioned earlier, please help to achieve this.