How can I turn these columns into rows?
This is the select statement
SELECT
MFGNO,
COMP,
COMP2,
LINER_CONFIG
FROM FG_STANDARD_BOMS
This is what I tried (recycled code I found)
SELECT
MFGNO,
COMP,
COMP2,
LINER_CONFIG
FROM (SELECT
CYCLETM,
MFGNO
FROM FG_STANDARD_BOMS) d
PIVOT
(
MAX(CYCLETM)
FOR MFGNO IN (MFGNO, COMP, COMP2, LINER_CONFIG)
) piv;
Msg 265, Level 16, State 1, Line 13 The column name "MFGNO" specified in the PIVOT operator conflicts with the existing column name in the PIVOT argument.