Avatar of sqlcurious
sqlcurious
Flag for United States of America asked on

pivot table query

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

Avatar of undefined
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
ASKER CERTIFIED SOLUTION
PortletPaul

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Vitor Montalvão

sqlcurious, do you need more help on this question?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
sqlcurious

ASKER
excellent! thanks