WITH 절 - 서브쿼리 중복 사용 방지
WITH b2 AS ( SELECT PERIOD, REGION, sum(LOAN_JAN_AMT) AS jan_amt FROM KOR_LOAN_STATUS GROUP BY PERIOD, REGION ), c AS (SELECT b.period, max(b.jan_amt) max_jan_amt FROM ( SELECT PERIOD, REGION, sum(LOAN_JAN_AMT) AS jan_amt FROM KOR_LOAN_STATUS GROUP BY PERIOD, REGION ) b, ( SELECT max(PERIOD) max_month FROM KOR_LOAN_STATUS GROUP BY SUBSTR(PERIOD, 1, 4) ) a WHERE b.period = a.max_month GROUP BY b...