-
Junior Member
Pivot columns
Is there any command to display ROWS as COLUMNS and vice-versa??
-
Re: Pivot columns
Try to use decode for the purpose.
-
Junior Member
Re: Pivot columns
Dear,
As this is requrie for the reports, it can be done to preapre the matrix report
-
Contributing Member
Re: Pivot columns
according to the moderator u can use decode for it
here is a sample------
with t as
(
select 'a' as col from dual
union
select 'a' from dual
union
select 'b' from dual
)
select *from t;
a
a
b
now yr needed code here --->
select
max(decode(rn, 1, col)) col1,
max(decode(rn, 2, col)) col2,
max(decode(rn, 3, col)) col3
from (
select col, row_number() over (partition by col order by col) rn
from t
order by col)
group by col
o/p is----------->
a a
b
hpoe u can get it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules