I don't think you can do this with unpivot
. I think you'll have to do something like:
Select
'p_01' type,
p_01 value,
'ofpk_01' type2,
ofpk_01 value2
From
test
Union All
Select
'p_02',
p_02,
'ofpk_02',
ofpk_02
From
test
Union All
Select
'p_03',
p_03,
'ofpk_03',
ofpk_03
From
test
Example Fiddle