当前位置:   article > 正文

Oracle listagg去重的两种方法_oracle listagg 去重

oracle listagg 去重

一:SELECT DISTINCT

       TYPE,

       SUBTYPE,

       LISTAGG (EN, ' | ')

          WITHIN GROUP (ORDER BY EN)

          OVER (PARTITION BY TYPE, SUBTYPE)

          AS SKILLS

  FROM (SELECT DISTINCT TYPE, SUBTYPE, EN

          FROM IKB

         WHERE SUBTYPE IN ('Technology_Database', 'test'))

二:

 regexp_replace((listagg(OV.PNR, ',' ) within group (order by OV.PNR)), '([^,]+)(,\1)+', '\1')

 

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/码创造者/article/detail/970852
推荐阅读
相关标签
  

闽ICP备14008679号