티스토리 뷰
반응형

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
- Pixel Pals
- 르세라핌
- 루미큐브 종류
- node.js
- 증권정보포털
- JMW 헤어드라이기기
- 화분벌레
- weka
- 남설 팔찌
- VARIDESK
- 톡토기
- 홈 오피스
- 별이 빚나는 밤
- 카카오 에드
- 파나소닉 비데 DL-EH10KWS
- 빈센트 반 고흐
- 매직 트랙패드2
- 오미크론
- 로니카 BCS
- 별잉 빛나는 밤
- 고체 향수
- Life Chair
- yugabyteDB
- 솔리드 쿨론
- 코라나 19
- GKRS
- 배당급
- Sybase IQ
- 유가바이트디비
- 브리다 정수기
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함