오라클 WM_CONCAT 함수



오라클 10g 에서 제공하는 함수로서,
세로로 된 데이터를 가로로 출력해주는 막강한 기능의 함수입니다.


WITH T AS
(
SELECT 1 NO, 5000 WON FROM DUAL UNION ALL
SELECT 1 NO, 3000 WON FROM DUAL UNION ALL
SELECT 2 NO, 6000 WON FROM DUAL UNION ALL
SELECT 3 NO, 4000 WON FROM DUAL UNION ALL
SELECT 3 NO, 7000 WON FROM DUAL UNION ALL
SELECT 3 NO, 2000 WON FROM DUAL UNION ALL
SELECT 4 NO, 5000 WON FROM DUAL UNION ALL
SELECT 4 NO, 7000 WON FROM DUAL
)
SELECT NO, WM_CONCAT(WON)
FROM T
GROUP BY NO
ORDER BY NO


No        Wm_concat(won)
------- -----------------
1          5000,3000
2          6000
3          4000,7000,2000
4          5000,7000




# 참고사이트
- Oracle의 숨겨진 함수 wmsys.wm_concat 에 관해
http://blog.naver.com/PostView.nhn?blogId=jinh2004&logNo=80092526183



 

+ Recent posts