i am trying to figure out how to do this, i have a unique, called PL_ITEM_NO, for every result i want up to the first 5 of this column ALT_COMPT to go horizontally like this.. PL_ITEM_NO,alt_1,Alt_2,Alt_3,Alt_4,Alt_5.

I can get two easily by saying min(ALT_COMPT) as alt_1,max(ALT_COMPT0 as alt_2, but how can i get it to cycle through and get 5 of them.below is what i am working with.

SELECT PL_ITEM_NO,
[1] AS ALT_1,
[2] AS ALT_2,
[3] AS ALT_3,
[4] AS ALT_4,
[5] AS ALT_5
FROM
(
SELECT T1.PL_ITEM_NO , T2.ALT_COMPT,ROW_NUMBER() OVER (PARTITION BY T1.PL_ITEM_NO ORDER BY T2.ALT_COMPT) AS Seq
FROM dbo.ext_pln_007_03_data AS T1 LEFT OUTER JOIN
dbo.ext_pln_007_03_data AS T2 ON T1.PL_ITEM_NO = T2.PL_ITEM_NO
)t
PIVOT(MAX(ALT_COMPT) FOR Seq IN ([1],[2],[3],[4],[5]))p