Anderson's Clipboard

2015年5月11日 星期一

Oracle listagg distinct

select col1, 
regexp_replace(
    listagg(col2, ',') within group (order by col2)
    ,'([^,]+)(,\1)+', '\1')
where rn = 1
group by col1;
ref from here
張貼者: 安德森 於 下午2:57
以電子郵件傳送這篇文章BlogThis!分享至 X分享至 Facebook分享到 Pinterest
較新的文章 較舊的文章 首頁
訂閱: 文章 (Atom)

網誌存檔

  • ▼  2015 (4)
    • ►  11月 (1)
    • ►  10月 (1)
    • ▼  5月 (1)
      • Oracle listagg distinct
    • ►  3月 (1)
  • ►  2014 (4)
    • ►  12月 (2)
    • ►  8月 (1)
    • ►  7月 (1)
  • ►  2013 (4)
    • ►  10月 (1)
    • ►  8月 (1)
    • ►  6月 (2)
頂尖企業主題. 技術提供:Blogger.