with cte as ( select 'a' as [1],'b' as [2],'c' as [3],'d' as [4],'e' as [5] ) select '1' as ItemName, [1] as value from cte union all select '2' as ItemName, [2] as value from cte
递归查询,将一行数据的多列转换成多行多列
with cte as ( select 'a' as [1],'b' as [2],'c' as [3],'d' as [4],'e' as [5] ) select '1' as ItemName, [1] as value from cte union all select '2' as ItemName, [2] as value from cte
递归查询,将一行数据的多列转换成多行多列