-- HOUR
SELECT
  ROUND(((TO_DATE('20111122110000', 'YYYYMMDDHH24MISS')-TO_DATE('20111122100000', 'YYYYMMDDHH24MISS'))*24),3) AS DIFF_HOUR
  FROM DUAL
  ;

-- MINUTE
SELECT
  ROUND(((TO_DATE('20111122110000', 'YYYYMMDDHH24MISS')-TO_DATE('20111122100000', 'YYYYMMDDHH24MISS'))*24*60),3) AS DIFF_MINUTE
  FROM DUAL
  ;

-- SECOND
SELECT
  ROUND(((TO_DATE('20111122110000', 'YYYYMMDDHH24MISS')-TO_DATE('20111122100000', 'YYYYMMDDHH24MISS'))*24*60*60),3) AS DIFF_SECOND
  FROM DUAL
  ;




저작자 표시
신고
posted by 뚱2