I have a table with a few columns, but only two are relevant to this search:
ITEMNMBR and ALTITEM1
Right now data appears as follows
ITEMNMBR ALTITEM1
A0001 ABCDEF
A0001 GBESJF
A0001 SDFJLK
B0001 JKHKJF
C0001 KLJSDF
C0001 MSXNCV
I would like to display the data so only one instance of each ITEMNMBR appears in the column with the corresponding ALTITEM1 values appearing in new columns.
ITEMNMBR ALTITEM_1 ALTITEM_2 ALTITEM_3
A0001 ABCDEF GBESJF SDFJLK
B0001 JKHKJF
C0001 KLJSDF MSXNCV
Each ITEMNMBR may have up to 20 ALTITEM1 values. If possible to add these columns dynamically that's great, but I figure that they need to be provisioned in the code...
SQL server 2008 R2