[Solved] SQL Server Transpose Rows Into New Table


I figured it out. See below for the code.

INSERT INTO Results (eventID,Result1,Result2,Result3,Result4,Result5)
SELECT eventID, [1] as Result1, [2] as Result2, [3] as Result3, [4] as Result4, [5] as Result5
FROM
(SELECT [inputTable].eventID,[inputTable].eQualType,[inputTable].Value1
FROM eventQData
WHERE eQualType IN (1, 2, 3, 4, 5) AND (Value2 > 0)
) AS inputTable
PIVOT
(MAX(Value1)
FOR [eQualType] IN ([1],[2],[3],[4],[5])

2

solved SQL Server Transpose Rows Into New Table