首页 > 代码库 > sql多行转一行,以逗号隔开

sql多行转一行,以逗号隔开

--SELECT ff= stuff((select ‘,‘+cast(WorkOrderNo as varchar)
-- FROM dbo.TB_WorkOrder c
-- where tpl.ProjectID=c.ProjectID
-- WHERE c.WorkOrderType=1
-- for xml path(‘‘)),1,1,‘‘)

sql多行转一行,以逗号隔开