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
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