Hi experts, attached is how I want the original table data to be transformed to the pivot table, pls suggest the query for this,. thanks Copy-of-PivotTable.xlsx
Microsoft SQL Server 2008
Last Comment
sqlcurious
8/22/2022 - Mon
Patrick Matthews
Some questions:
1) Is RowNum an actual column in the table?
2) If so, how is it generated? For example, is it a sequence number for the tale as a whole, or does it restart at 1 for each customer?
3) Did you mean to handle the Value, ImagePath, and Description columns the way you did in the example?
4) What would you expect to see if a given customer had, say, 47 different items in the original table?
sqlcurious
ASKER
Hi Patrick, Sorry about not giving further details in the original post.
RowNum is actual column, it does start with 1, this is generated by a different process and every customers will have only 3 items, so there wont be a question of 47 different items
About your pointer 3, I am sorry about the data , it got skewed while copying, my intention was to remove value field completely since I don't need it in the new table, attached is a much relevant one.
Thanks! Copy-of-PivotTable.xlsx
1) Is RowNum an actual column in the table?
2) If so, how is it generated? For example, is it a sequence number for the tale as a whole, or does it restart at 1 for each customer?
3) Did you mean to handle the Value, ImagePath, and Description columns the way you did in the example?
4) What would you expect to see if a given customer had, say, 47 different items in the original table?