I have the following table:
create table #prd
(
ver varchar(20),
fam varchar(20),
mm varchar(20),
)
insert into #prd values('dt','fam1','111')
insert into #prd values('dt','fam1','222')
insert into #prd values('mb','fam1','333')
insert into #prd values('mb','fam2','444')
I need the output as below using CTE:
ver family MM
------- --------- ----------
DT fam1 111,222
mb fam1 333
mb fam2 444
Please help!!
A CTE version that does not use
for xml path('')