select [value] = stuff((select ','+modmb003 from modmb detail where modmb=18 for xml path('')), 1, 1, '')
其中stuff的作用是:删除指定长度的字符,并在指定的起点处插入另一组字符
语法:STUFF ( character_expression , start , length ,character_expression )
列:SELECT STUFF('abcdef', 2, 3, 'ijklmn')
结果为:aijklmnef