[Oracle] 비교절에 현재시간 + 문자열 넣기
HAVING TO_CHAR(CARD_TRANSACTION_TIME, 'YYYY-MM') = (SELECT TO_CHAR(SYSDATE, 'YYYY')||'-12' FROM DUAL) SELECT SUBQUERY1.NUM AS "1월", SUBQUERY2.NUM AS "2월", SUBQUERY3.NUM AS "3월", SUBQUERY4.NUM AS "4월", SUBQUERY5.NUM AS "5월", SUBQUERY6.NUM AS "6월", SUBQUERY7.NUM AS "7월", SUBQUERY8.NUM AS "8월", SUBQUERY9.NUM AS "9월", SUBQUERY10.NUM AS "10월", SUBQUERY11.NUM AS "11월", SUBQUERY12.NUM AS "12월" FROM (SE..
[Oracle] 조회된 ROW가 없을 때, RETURN 하는 방법
SELECT SUBQUERY1.NUM AS "1월", SUBQUERY2.NUM AS "2월", SUBQUERY3.NUM AS "3월", SUBQUERY4.NUM AS "4월", SUBQUERY5.NUM AS "5월", SUBQUERY6.NUM AS "6월", SUBQUERY7.NUM AS "7월", SUBQUERY8.NUM AS "8월" FROM (SELECT SUM(CARD_TRANSACTION_AMOUNT) AS NUM FROM CARD_TRANSACTION_TEST01 GROUP BY TO_CHAR(CARD_TRANSACTION_TIME, 'YYYY-MM') HAVING TO_CHAR(CARD_TRANSACTION_TIME, 'YYYY-MM') = '2020-01') SUBQUERY1, (SELEC..