sqlserver将查询的单列结果集拼成一行字符串用逗号分隔

select stuff((select ','+[Categories] from [sys_Category] where [CategoriesNo] in (105,301,601) for xml path('')),1,1,'')

你可能感兴趣的:(sqlserver)