티스토리 뷰
반응형

The LISTAGG syntax is:
LISTAGG ( measure_expr [, delimiter]) WITHIN GROUP (order_by_clause) [OVER query_partition_clause]
LISTAGG Parameters
There are several mandatory and optional parameters in the LISTAGG function. The parameters of the LISTAGG function are:
measure_expr (mandatory): This is the column (or expression) that you wish to concatenate the values of. In the example above, I used last_name.
delimiter (optional): This is the delimiter, or the character in between each value of measure_expr. If this is not specified, no value is used.
order_by_clause (mandatory): This is the order of the concatenated values in measure_expr are listed.
query_partition_clause (optional): This allows you to use LISTAGG as an analytic function, which we will see in the examples section below.
LISTAGG 함수는 가끔 사용했었는데, Partition 절을 함께 사용하는 방법은 최근에 알게 되어 유용하게 사용했습니다.
SELECT T1.*
,LISTAGG(PRDT_CD, ',') WITHIN GROUP(ORDER BY PRDT_CD) OVER(PARTITION BY ORN_ID, ORN_PRDT_NO) AS PRDT_CD_S
FROM TT_TEST T1

반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 홈 오피스
- 솔리드 쿨론
- weka
- 빈센트 반 고흐
- Life Chair
- 파나소닉 비데 DL-EH10KWS
- Pixel Pals
- JMW 헤어드라이기기
- 증권정보포털
- 남설 팔찌
- 톡토기
- 별잉 빛나는 밤
- 고체 향수
- 매직 트랙패드2
- 브리다 정수기
- node.js
- VARIDESK
- 로니카 BCS
- 오미크론
- 카카오 에드
- 루미큐브 종류
- 화분벌레
- 코라나 19
- 유가바이트디비
- yugabyteDB
- 별이 빚나는 밤
- Sybase IQ
- 르세라핌
- 배당급
- GKRS
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
글 보관함