标签:多行 for href pat .com sql查询 查询语句 lan htm
【原地址】
for xml path作用:将多行的查询结果,根据某一些条件合并到一行。
例:现有一张表
执行下面语句
select Department,
(SELECT Employee+‘,‘ FROM People b WHERE b.Department=a.Department For XML Path(‘‘)) Student
from People as a
group by Department
得如下结果
标签:多行 for href pat .com sql查询 查询语句 lan htm
原文地址:https://www.cnblogs.com/yilong-/p/8892150.html