oracle之分组内的字符串连接

实现效果:

例如下面的数据
[php]
groupid        personid        name
1            a             超级管理员
2            b                  管理员
2            c                  测试员
3            a                  超级管理员
4            b                  管理员
5            b                  管理员
5            c                  测试员
5            a                  超级管理员
5            d                  领导
6            c                  测试员
6            b                  管理员
7            a                  超级管理员
8            a                  超级管理员

我想要下面的查询结果
1        超级管理员
2        管理员;测试员
3        超级管理员
4        管理员
5        管理员;测试员;超级管理员;领导
6        测试员;管理员
7        超级管理员
8        超级管理员

SQL:

select id ,wmsys.wm_concat(name) from t group by id;

参考:http://www.itpub.net/thread-1414207-1-1.html

   http://www.oracle-base.com/articles/misc/string-aggregation-techniques.php

原文地址:https://www.cnblogs.com/smallrock/p/3904120.html