To, co chcete, se nazývá UNPIVOT
a udělá se takto:
select id,field,value from
#document_fields
unpivot
(
value
for field in (x,y,z)
) as u
order by id,field
To, co chcete, se nazývá UNPIVOT
a udělá se takto:
select id,field,value from
#document_fields
unpivot
(
value
for field in (x,y,z)
) as u
order by id,field