如何在SQL Server中将多行文本合并为单个文本字符串?

霸气de小男生 提交于 2020-08-05 04:09:02

问题:

Consider a database table holding names, with three rows: 考虑一个包含名称的数据库表,该表具有三行:

Peter
Paul
Mary

Is there an easy way to turn this into a single string of Peter, Paul, Mary ? 有没有简单的方法可以将其转换为Peter, Paul, Mary一串文字?


解决方案:

参考一: https://stackoom.com/question/ogm/如何在SQL-Server中将多行文本合并为单个文本字符串
参考二: https://oldbug.net/q/ogm/How-to-concatenate-text-from-multiple-rows-into-a-single-text-string-in-SQL-server
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!