Appearance
🏷️ SQL
SELECT NAME, STUFF( (SELECT ','+fv+'' FROM #TEMP tb1 WHERE tb1.name=tb.name FOR xml path('') ),1,1,'') AS fv --截取查询的结果集合,替换第一个字符 FROM #TEMP AS tb GROUP BY tb.NAME
参考:SQL 语句及关键字的用法