I have a normal select query which results following output.
select cid,x1,x2,x3,x4,fy from temp_table; cid x1 x2 x3 x4 fy -----------------------
You can do it with combination of unpivot and pivot.
select * from (select * from (select x1,x2,x3,x4,fy from table1) unpivot(val for x in (x1,x2,x3,x4))) pivot(sum(val) for fy in (2014,2015,2016))