구분자로 입력된 값을 행으로 분류후 통계 내기
WITH RTOTAL AS ( SELECT MAIN_SEQ, COUNT(MAIN_SEQ) AS TOT FROM S_REPLY GROUP BY MAIN_SEQ ) SELECT M.MAIN_SEQ, M.SUB_SEQ, M.IKEY, M.INAME, M.GNAME, NVL(R.CNT, 0) AS CNT, NVL(T.TOT, 0) AS TOT, ROUND((NVL(R.CNT, 0)/NVL(T.TOT, 0))*100, 1) AS RND, M.SORT FROM S_QUEST_MULTI M ,( SELECT IDX, QIDX, EX_SPLIT, COUNT(EX_SPLIT) AS CNT FROM ( SELECT IDX, QIDX, MEMBER_ID, REGEXP_SUBSTR(R.EX, '[^\;]+', 1, L.LEV..
더보기
테이블 정보 조회 쿼리
SELECT * FROM ( SELECT A.TABLE_NAME, A.COLUMN_ID, A.COLUMN_NAME, A.DATA_TYPE, A.DATA_LENGTH, A.DATA_PRECISION, A.DATA_SCALE, A.NULLABLE, A.DATA_DEFAULT, B.COMMENTS FROM USER_TAB_COLUMNS A, USER_COL_COMMENTS B WHERE A.TABLE_NAME = B.TABLE_NAME AND A.COLUMN_NAME = B.COLUMN_NAME ORDER BY A.TABLE_NAME, A.COLUMN_ID )
더보기