Oracle Rows into Columns
- by user2904845
Can someone help me design the query to get below o/p.
Data I have:
Table X:
Count Name Amount Days
5 ABC 500 Day1
10 ABC 1000 Day2
3 BCD 100 Day1
4 BDC 200 Day2
Result I need:
Name Count AmountDay1 Count AmountDay2
ABC 5 500 10 1000
BCD 3 100 4 200
etc
Is this Possible?
I tried something with the below query, but not getting the desired o/p
select * from X
pivot
(sum(amount) for days in ('Day1', 'Day2'))
Please help
I'm using Oracle 11 G