oracle 查询结果 以 逗号分隔

  1. Oracle 11g 版本支持 使用 wm_concat 函数
    select entity,wm_concat(RIGHT_TYPE) types from common_dataright_filed group by entity

     

  2. Oracle 12 不支持wm_concat 函数,使用 listagg(RIGHT_TYPE,',') within group (order by entity)
    select entity,listagg(RIGHT_TYPE,',') within group (order by entity) types from common_dataright_filed group by entity

     

posted @ 2019-04-30 10:57  stroop  阅读(676)  评论(0)    收藏  举报