티스토리 뷰
반응형

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