SOCCER_TEAM (세로)
MANUTD
MANCITY
QPR
================
SOCCER_TEAM (가로)
MANUTD,MANCITY,QPR
===> 쿼리문
오라클 10G (WM_CONCAT 함수이용)
예제 : SELECT wm_concat(decode(SOCCER_TEAM,'',' ',SOCCER_TEAM)) FROM 테이블명
오라클 11G (LISTAGG 함수이용)
예제 : SELECT LISTAGG(COL1, ',') WITHIN GROUP (ORDER BY COL1) FROM 테이블명
select
e.deptno, cursor(select ename from emp where deptno = e.deptno)
from emp e
group by e.deptno
;
댓글 없음:
댓글 쓰기