Oracle
 sql >> Database >  >> RDS >> Oracle

Utilizzare Seleziona o PL SQL per trasporre

Un modo per farlo è un'unione:

WITH YourWith as (
    select value1, value2, value3, ...
    from YourTable
)
select name = 'Current', value1 from YourWith
union all
select name = 'Past1', value2 from YourWith
union all
select name = 'Past2', value3 from YourWith
union all
...