Предложение PIVOT
может обрабатывать более одного сводного столбца одновременно:
create table t(age,sex,val,opt ) as
select 1, 'f', 0.019500000000000000, 'OPTION_1' from dual union all
select 2, 'f', 0.019500000000000000, 'OPTION_1' from dual union all
select 3, 'f', 0.019500000000000000, 'OPTION_1' from dual union all
select 4, 'f', 0.019500000000000000, 'OPTION_1' from dual union all
select 5, 'f', 0.019500000000000000, 'OPTION_1' from dual union all
select 1, 'm', 0.081000000000000002, 'OPTION_1' from dual union all
select 2, 'm', 0.081000000000000002, 'OPTION_1' from dual union all
select 3, 'm', 0.081000000000000002, 'OPTION_1' from dual union all
select 4, 'm', 0.081000000000000002, 'OPTION_1' from dual union all
select 5, 'm', 0.081000000000000002, 'OPTION_1' from dual union all
select 1, 'f', 0.159000000000000002, 'OPTION_2' from dual union all
select 2, 'f', 0.107999999999999999, 'OPTION_2' from dual union all
select 3, 'f', 0.073500000000000009, 'OPTION_2' from dual union all
select 4, 'f', 0.063000000000000000, 'OPTION_2' from dual union all
select 5, 'f', 0.059999999999999997, 'OPTION_2' from dual union all
select 1, 'm', 0.307499999999999996, 'OPTION_2' from dual union all
select 2, 'm', 0.220500000000000002, 'OPTION_2' from dual union all
select 3, 'm', 0.156000000000000000, 'OPTION_2' from dual union all
select 4, 'm', 0.133500000000000008, 'OPTION_2' from dual union all
select 5, 'm', 0.115500000000000005, 'OPTION_2' from dual;
select * from t
pivot(max(val) for (sex, opt) in (
('f','OPTION_1') as f_1,
('m','OPTION_1') as m_1,
('f','OPTION_2') as f_2,
('m','OPTION_2') as m_2
));
AGE F_1 M_1 F_2 M_2
1 0,0195 0,081000000000000002 0,159000000000000002 0,307499999999999996
2 0,0195 0,081000000000000002 0,107999999999999999 0,220500000000000002
4 0,0195 0,081000000000000002 0,063 0,133500000000000008
5 0,0195 0,081000000000000002 0,059999999999999997 0,115500000000000005
3 0,0195 0,081000000000000002 0,073500000000000009 0,156