Here is my data
Id type count
1 jim 2
1 bim 2
1 sim 3
1 pim 1
2 jim 2
2 bim 1
Want to convert this data into below
Id jim bim sim pim
1 2 2 3 1
2 2 1 0 0
Tried this, its now working
select * FROM table
PIVOT
(
Min(Id)
FOR Id IN (select distinct(type) from table)
)
I'm trying to convert all distinct values of type
row into columns and then assign respective values against every ID. Any suggestion please ?
Error
ORA-00936: missing expression
00936. 00000 - "missing expression"
*Cause:
*Action:
Error at Line: 26 Column: 16