행위

"오라클 listagg 함수"의 두 판 사이의 차이

DB CAFE

23번째 줄: 23번째 줄:
 
   group  by table_name;
 
   group  by table_name;
 
</source>
 
</source>
 +
[[Category:oracle]]

2019년 12월 22일 (일) 15:11 판

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;