Here is some sample data from the Orders table (Sql server 2014)
Note: There is not a set number of product and producttype combinations. It grows constantly
OrderId Product ProductType
1 TV Electronics
1 Jeans Clothes
1 Dresser Furniture
2 Monopoly Board Games
2 Socks Clothes
I would like to combine all entries for the same order number into a single row
using the sample data I would like the query to return the following
OrderID Product1 ProductType1 Product2 ProductType2 Product3 Product3
1 TV Electronics Jeans Clothes Dresser Furniture
2 Monopoly Board Games Socks Clothes
Our community of experts have been thoroughly vetted for their expertise and industry experience.