Hi,
Can we switch the tables rows to columns like this?using sql server 2012
Declare @mySpecTable table(prodID int,prodName varchar(30),specName varchar(100), specValue varchar(100))
Insert into @mySpecTable values
(1,'Sink1','Shape','Round')
,(1,'Sink1','Color','White')
,(1,'Sink1','Style','Pedestal')
,(2,'Sink2','Shape','Square')
,(2,'Sink2','Color','Black')
,(2,'Sink2','Style','Wallmount')
,(3,'Sink3','Shape','Round')
,(3,'Sink3','Color','White')
,(3,'Sink3','Style','Pedestal')
prodID prodName specName specValue
1 Sink1 Shape Round
1 Sink1 Color White
1 Sink1 Style Pedestal
2 Sink2 Shape Square
2 Sink2 Color Black
2 Sink2 Style Wallmount
3 Sink3 Shape Round
3 Sink3 Color White
3 Sink3 Style Pedestal
Required display
ProductName Shape Color Style
Sink1 Round White Pedestal
Sink2 Square Black Wallmount
Sink3 Round White Pedestal