SELECT STUFF((select ','+MD.DepartmentName
from DepartmentMaster MD where
MD.PK_DepartmentID in ( select TPD.FK_DepartmentID
from ProductDepartment TPD where TPD.FK_ProductID=PM.PK_ProductID )
order by '],['+md.DepartmentName
for xml path('')),1,1,'')DepartmentName
FROM MstProduct PM
No comments:
Post a Comment