记录mysql 的group_concat函数用方法

表结构如下:
id   rod_id  role_name
1     1      超级管理员
2     1      管理员
3     1      系统管理员
4     2      高级会员
5     3      普通会员
6     4      游客

实现sql
select role_id,group_concat(role_name) from roles group by role_id;

这个在oracle10g以下版本中比较难实现,oracle10g中可以用WM_CONCAT函数

你可能感兴趣的:(group_concat)