我将竭诚为您翻译。以下是要翻译的内容:
我试图围绕其许多列旋转数据表格,以得到3个列(旋转列、列名、值)
例如:
例如:
name | age | gender
------+-------+---------
John | 20 | M
Jill | 21 | F
将成为:
name | column | value
-----+--------+-------
John | age | 20
John | gender | M
Jill | age | 21
Jill | gender | F
我已经通过谷歌搜索了很多,但没有找到类似的情况 - 特别是因为这个中心点似乎是相反方向完成的,与我想要实现的相反。
CROSS APPLY
is a great solution but I suspect you may need to quote[column]
- CervEd