"오라클 listagg 함수"의 두 판 사이의 차이
DB CAFE
12번째 줄: | 12번째 줄: | ||
) within group (order by cols) | ) within group (order by cols) | ||
+ | </source> | ||
+ | |||
+ | 예시) | ||
+ | <source lang=sql> | ||
+ | select table_name, | ||
+ | listagg(index_name, ',' on overflow truncate | ||
+ | |||
+ | ) within group (order by index_name) inds | ||
+ | from user_indexes | ||
+ | group by table_name; | ||
</source> | </source> |
2019년 7월 19일 (금) 09:32 판
thumb_up 추천메뉴 바로가기
- DBA { Oracle DBA 명령어 > DBA 초급 과정 > DBA 고급 과정 }
- 튜닝 { 오라클 튜닝 목록 }
- 모델링 { 데이터 모델링 가이드 }
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;