摘要:
背景今天在博问上看到一个SQL语句需求:表结构 id name 1 罗涛 1 涛帅帅 2 刘亮 2 亮哥 2 亮傻要得出结果 id name 1 罗涛,涛帅帅 2 刘亮,亮哥,亮傻解决方案这是一个典型的分组合并的需求,一般有两种方法,一是写一个函数处理,二是用xml for path方法,代码如下:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1--建立测试环境2CreatetableBWTEST3(4idInt,5nameVarc... 阅读全文