1 sql server 利用多重赋值将一列的数据以逗号分隔,返回

declare @mav varchar(max)
select @mav=coalesce(@mav+', '+d.Name,d.Name)
   from ( select Name
     from HumanResources.Department) d
order by d.Name

select @mav
原文地址:https://www.cnblogs.com/mibing/p/7521371.html