Tsql 将单元格连接在一起以缩短sql
假设t-sql中的select语句返回Tsql 将单元格连接在一起以缩短sql,tsql,select,concatenation,Tsql,Select,Concatenation,假设t-sql中的select语句返回 John Smith | Chicago | a John Smith | Chicago | f John Smith | Chicago | j Josh Dude | Houston | p Josh Dude | Houston | s 我希望它能回来 John Smith | Chicago | a, f, j Josh Dude | Houston | p, s 如何做到这一点?本文的前半部分是一个代码和图像密
John Smith | Chicago | a
John Smith | Chicago | f
John Smith | Chicago | j
Josh Dude | Houston | p
Josh Dude | Houston | s
我希望它能回来
John Smith | Chicago | a, f, j
Josh Dude | Houston | p, s
如何做到这一点?本文的前半部分是一个代码和图像密集型教程,介绍如何使用STUFF和FOR XML PATH语句获取一个规范化集,并将一列转换为一个逗号分隔的值
祝你好运 可能重复您是否尝试过任何方法来解决您的问题?