vertica union
-
Access 형태에 따른 비교VERTICA/08. SQL Workaround Guide 2015. 8. 6. 13:44
SELECT 중략... , SUM(current_month) current_month FROM ( SELECT 중략... , COUNT(CASE WHEN A.yyyymm = 201301 THEN A.mem_no END) AS current_month FROM mem_use_table A 중략... UNION ALL SELECT 중략... , COUNT(CASE WHEN A.yyyymm = 201301 THEN A.mem_no END) AS current_month 중략... , CASE WHEN 'J' = amen_ccode THEN 'expression' END ccode , CASE WHEN B.mem_no IS NOT NULL THEN 1 END acc_no 중략... WHERE A.yyyymm I..