다중 Row 결과를 단일행으로 컴마로 분리해 출력하는 방법
SELECT SUBSTR (MAX (SYS_CONNECT_BY_PATH (ename, ',')), 2) path# FROM (SELECT ename, ROWNUM rnum FROM emp) START WITH rnum = 1 CONNECT BY PRIOR rnum = rnum - 1 SELECT deptno, SUBSTR (MAX (SYS_CONNECT_BY_PATH (ename, ',')), 2) path# FROM (SELECT ename, deptno, ROW_NUMBER () OVER (PARTITION BY deptno ORDER BY ename) rnum FROM emp) START WITH rnum = 1 CONNECT BY PRIOR rnum = rnum - 1 AND PRIOR deptn..
오라클 테이블정보 쿼리
잘되는군...ㅋㅋㅋㅋㅋㅋㅋ SELECT owner, (SELECT TRIM (comments) FROM all_tab_comments WHERE owner = a.owner AND table_name = a.table_name) AS tab_comment, a.table_name, a.column_name AS col_name, DECODE (a.data_type, 'DATE', 'DATE', 'NUMBER', 'NUMBER(' || data_length || DECODE (data_precision, NULL, '', ',' || data_precision) || ')', a.data_type || '(' || data_length || ')' ) AS data_type, data_length AS d..