I work on sql server 2012 i face issue ican't represent rows as column .
i need to represent code type from details table to display as column with
values of countparts
join between master zplid and details zplid is zplid
every zplid have group of code type so instead of represent code type as rows
i will represent it as columns
columns will have header as code type and content column will be countparts
so How to do that please ?
create table #zplidmaster
insert into #zplidmaster(zplid,zplidname)
create table #zpliddetails ( zplid int, CodeType int, CountParts int ) insert into #zpliddetails(zplid,CodeType,CountParts) values (4124,9089,9011), (4124,7498,7000), (4125,9089,2000), (4125,7498,1000), (4145,9089,3000), (4145,7498,8500), (4170,9089,7600), (4170,7498,6600), (4190,9089,9001), (4190,7498,9003)