This is my SQL statement
select id , name, type, value from table1 a
INNER JOIN table2 b on a.id = b.id
where b.type in ('display','contact','ship')
which produces below result
ID name type value
5 test display display1
5 test contact contact1
5 test ship ship1
6 test2 display display2
6 test2 contact contact2
6 test2 ship ship2
I need to get result in kind of pivoted format like this
id name display contact ship
5 test display1 contact1 ship1
6 test2 display2 contact2 ship2
I tried this solution : https://stackoverflow.com/a/6849706/2645738 ,but its giving me the same result (3 rows for each data). It's like i need to group by id and name,but don't know how to make display,contact,ship as columns.
Would you please help me for the same.