[ORACLE] TO_CHAR, TO_DATE 함수로 초까지 나타내기
SELECT TO_CHAR(TO_DATE('20200324', 'YYYYMMDDHH24MISS'), 'YYYY-MM-DD HH24:MI:SS') AS TO_DATE_형식1 , TO_CHAR(TO_DATE('20200324', 'YYYYMMDDHH24MISS'), 'YYYY/MM/DD HH24:MI:SS') AS TO_DATE_형식2 , TO_CHAR(TO_DATE('20200324', 'YYYYMMDDHH24MISS'), 'DD/MM/YYYY HH24:MI:SS') AS TO_DATE_형식3 FROM DUAL; SELECT TO_DATE('20180101010101', 'YYYYMMDDHHMISS') AS GO FROM DUAL; SELECT TO_DATE('20180101000035', 'YYYYMMD..
[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..