MULTIPLE ROWS WITH SAME DATA EXCEPT ONE COLUMN , THEN WE CAN CONVERT INTO ONE ROW WITH COMMA SEPERATOR
select p.assignNum, p.description, p.startDate, stuff((select ', ' + cast(employeeNum as varchar(512))from #TableChild c where c.ASSIGNNUM = p.ASSIGNNUM for xml path('')),1,2,'') as employeeList from #TableParent p ;
No comments:
Post a Comment