Вы хотите отключить и повторно развернуть.Вот один из методов:
select s_no,
max(case when name = 'test1' then num else 0 end) as test1,
max(case when name = 'test2' then num else 0 end) as test2,
max(case when name = 'test3' then num else 0 end) as test3,
max(case when name = 'test4' then num else 0 end) as test4
from ((select name, 'no1' as s_no, no1 as num from t
) union all
(select name, 'no2', no2 from t
)
) nn
group by s_no
order by s_no;