Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pivot table

Status
Not open for further replies.

fosa

IS-IT--Management
Mar 18, 2008
26
0
0
FR
Hello everybody

I have a table
and
I want to pivot

my request is


select info_date,
max(decode( dense_rank, 1, last_price,null )) as "TICKER1
max(decode( dense_rank, 2, last_price,null )) as "TICKER2",
max(decode( dense_rank, 3, last_price,null )) as "TICKER3"
from (
select info_date, last_price,
dense_rank() over( partition by info_date order by ticker ) dense_rank
from my_table
)
where dense_rank <= 3
group by info_date
/

how can i change this to dynamically use all tickers in the table my_table instead of using hardcoded ticker

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top