행위

오라클 listagg 함수

DB CAFE

Dbcafe (토론 | 기여)님의 2019년 7월 19일 (금) 09:32 판
thumb_up 추천메뉴 바로가기


ListAgg

  • Row를 Col로 변경

Syntax (12c 개선)

LISTAGG(
    COLUMN, ','
    [ on overflow (truncate|error) ]
    [ text ] [ (with|without) count ]
  ) within group (order by cols)

예시)

select table_name,
         listagg(index_name, ',' on overflow truncate
            'click here'
         ) within group (order by index_name) inds
  from   user_indexes
  group  by table_name;