当前位置: 代码迷 >> Oracle管理 >> 字段连接有关问题
  详细解决方案

字段连接有关问题

热度:6   发布时间:2016-04-24 05:09:25.0
字段连接问题,在线等
现有一张表,内容如下:
ID NAME A
1 张三 a
1 张三 b
2 李四 a
3 王五 a
3 王五 b
3 王五 c

通过查询得出如下结果:
ID NAME A
1 张三 a,b
2 李四 a
3 王五 a,b,c

要达到这种查询结果,语句应该怎么写?

------解决方案--------------------
wm_concat

select id,name,wm_concat(A) as A from table
group by id,name
------解决方案--------------------
SQL code
select id,name,wmsys.wm_concat(A) A from tablegroup by id,name
  相关解决方案