我目前无法访问服务器来对此进行测试,但是我将如何去做类似以下的事情
UNPIVOT (X for XY IN (
SELECT column_name AS [XY]
FROM Information_schema.Columns
WHERE Table_name = XYZ AND column_name LIKE '[0-9][0-9][0-9][0-9]'
)) AS unpivotedData
即是否可以动态填充要取消透视的列列表而不是静态声明它们
我目前无法访问服务器来对此进行测试,但是我将如何去做类似以下的事情
UNPIVOT (X for XY IN (
SELECT column_name AS [XY]
FROM Information_schema.Columns
WHERE Table_name = XYZ AND column_name LIKE '[0-9][0-9][0-9][0-9]'
)) AS unpivotedData
即是否可以动态填充要取消透视的列列表而不是静态声明它们