且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将行值转换为SQL Server中的列

更新时间:2023-01-20 18:02:23

此示例将帮助您:



this example will help u:



SELECT UserID, VendorName, [abc1], [abc2], [abc3]
FROM Questions
PIVOT (MAX(AnswerText)
    FOR QuestionText IN ([abc1], [abc2], [abc3])
) AS pvt