问题语句如下:
select role_cd,listagg(xm.nm,',')within group(order by role_cd)name
from xap_role_menu xrm
left join xap_menu xm
on xrm.menu_cd = xm.menu_cd
where xrm.del_f ='0'
and xm.del_f ='0'
and xrm.role_cd='XAPM14.01'
group by role_cd;
修改后的语句如下:利用xmlagg + xmlparse语法
select role_cd,xmlagg(xmlparse(content xm.nm||',')order by role_cd).getclobval()
from xap_role_menu xrm
left join xap_menu xm
on xrm.menu_cd = xm.menu_cd
where xrm.del_f ='0'
and xm.del_f ='0'
and xrm.role_cd='XAPM14.01'
group by role_cd;
网友评论