使用oracle中自带函数 wmsys.wm_concat(需合并列的字段名)
用法如下:
select code,name,wmsys.wm_concat(baname) from tab group by code,name;