첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
WITH SOURCE_TABLE AS
(
    SELECT '고구려' COUNTRY, '1대' ST, '동명성왕'   KING_NAME FROM DUAL UNION ALL
    SELECT '고구려' COUNTRY, '3대' ST, '대무신왕'   KING_NAME FROM DUAL UNION ALL
    SELECT '백제'   COUNTRY, '1대' ST, '온조왕'     KING_NAME FROM DUAL UNION ALL
    SELECT '고구려' COUNTRY, '2대' ST, '유리왕'     KING_NAME FROM DUAL UNION ALL
    SELECT '백제'   COUNTRY, '3대' ST, '기루왕'     KING_NAME FROM DUAL UNION ALL
    SELECT '신라'   COUNTRY, '1대' ST, '남해왕'     KING_NAME FROM DUAL UNION ALL
    SELECT '신라'   COUNTRY, '1대' ST, '박혁거세'   KING_NAME FROM DUAL UNION ALL
    SELECT '백제'   COUNTRY, '2대' ST, '다루왕'     KING_NAME FROM DUAL UNION ALL
    SELECT '신라'   COUNTRY, '1대' ST, '유리이사금' KING_NAME FROM DUAL
)
SELECT
    COUNTRY
   ,WM_CONCAT(KING_NAME) KING_NAME
FROM SOURCE_TABLE
GROUP BY COUNTRY;

/*
COUNTRY KING_NAME
------- --------------------------
고구려  동명성왕,유리왕,대무신왕
백제    온조왕,다루왕,기루왕
신라    남해왕,유리이사금,박혁거세
*/
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요