更新时间:2022-12-09 21:47:05
这是一个非常简单的支点.只是:
That's a very straightforward pivot. Just:
SELECT OperationSessionRecordID, [32],[34],[38]
FROM TEMPtable
PIVOT (
min(DebriefingQuestionResults)
for questionid in ([32], [34], [36])
) AS PIV;
您无需执行任何特殊操作即可通过 OperationSessionRecordID
获得分组 - 基本上,PIVOT
中未提及的每一列都是分组列.
You don't need to do anything special to get the grouping by OperationSessionRecordID
- essentially, every column not mentioned in the PIVOT
is a grouping column.