首页 > 代码库 > 15. "wm_concat"_数据库中将查询出来的多条记录中的某个字段用“,”拼接起来

15. "wm_concat"_数据库中将查询出来的多条记录中的某个字段用“,”拼接起来

例子:

select wm_concat(roleid) from lbmember where userid = ?

值的形式:1,2,3

下面是把1,2,3转换为1;2;3
select replace((select wm_concat(roleid) from lbmember where userid = ?),‘,‘,‘;‘) from dual

15. "wm_concat"_数据库中将查询出来的多条记录中的某个字段用“,”拼接起来