📌  相关文章
📜  逗号分隔连接 mssql 代码示例

📅  最后修改于: 2022-03-11 15:05:31.149000             🧑  作者: Mango

代码示例1
select SM.ROLLNO,
       SM.NAME, 
       SM.ADDRESS,
       (
       select ','+CM.CourseName
       from dbo.CourseMaster as CM
       where ','+SM.Course+',' like '%,'+CM.CourseId+',%'
       for xml path(''), type
       ).value('substring(text()[1], 2)', 'varchar(max)') as Course
from dbo.StudentMaster as SM;