有时候使用listagg(id,',') within group(order by id )得到的数据里面有很多重复的数据,注意listagg中已经排过序,这是前提,如下所示

      
oracle regexp_replace过滤字符串中重复内容
      可以使用regexp_replace替换掉重复的内容(数字),方便使用

       如下所示

      

select substr(regexp_replace(',&1', '(,[[:digit:]]+)(\1)+', '\1'), 2)
  from dual

    结果如下

   
oracle regexp_replace过滤字符串中重复内容
    
oracle regexp_replace过滤字符串中重复内容
       这时候在使用就很方便了

 

        全文完

 

 

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2021-04-09
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
猜你喜欢
  • 2021-05-16
  • 2021-12-30
  • 2021-08-17
  • 2022-12-23
  • 2021-12-05
  • 2022-01-16
  • 2022-12-23
相关资源
相似解决方案