분단위 24 * 60
초단위 24 * 60 * 60
SELECT CURRENT_DATE, SYSDATE, FROM_TZ(timestamp_value,time_zone_value)
FROM DUAL
TO_DSINTERVAL
TO_DSINTERVAL(CHAR 'nlsparam')
SELECT *
FROM PLAN_TABLE
SELECT ER.REPAIR_TO_TIME, TO_DATE(ER.REPAIR_TO_TIME, 'HH24MISS'), ER.REPAIR_FROM_TIME, TO_DATE(ER.REPAIR_FROM_TIME, 'HH24MISS'),
TO_DATE(ER.REPAIR_TO_TIME, 'HH24MISS') - TO_DATE(ER.REPAIR_FROM_TIME, 'HH24MISS'),
FLOOR(TO_DATE(ER.REPAIR_TO_TIME, 'HH24MISS') - TO_DATE(ER.REPAIR_FROM_TIME, 'HH24MISS') ) "일",
MOD( TO_DATE(ER.REPAIR_TO_TIME, 'HH24MISS') - TO_DATE(ER.REPAIR_FROM_TIME, 'HH24MISS'), 1) * 24,
FLOOR( MOD( TO_DATE(ER.REPAIR_TO_TIME, 'HH24MISS') - TO_DATE(ER.REPAIR_FROM_TIME, 'HH24MISS'), 1) * 24 ) "시간",
MOD( MOD( TO_DATE(ER.REPAIR_TO_TIME, 'HH24MISS') - TO_DATE(ER.REPAIR_FROM_TIME, 'HH24MISS'), 1
) * 24, 1
) * 60,
FLOOR( ROUND(MOD( MOD( TO_DATE(ER.REPAIR_TO_TIME, 'HH24MISS') - TO_DATE(ER.REPAIR_FROM_TIME, 'HH24MISS'), 1
) * 24, 1
) * 60
)
) "분",
FLOOR( MOD( MOD( MOD( TO_DATE(ER.REPAIR_TO_TIME, 'HH24MISS') - TO_DATE(ER.REPAIR_FROM_TIME, 'HH24MISS'), 1
) * 24, 1
) * 60, 1
) * 60
) "초"
FROM L_EQUIP_REPAIR ER
WHERE SUBSTR(ER.REPAIR_FROM_TIME, 1, 2) >= '12'
(enddate-startdate)*24
SELECT FLOOR(CLOSE_TIME - BEGINNING_TIME) AS "일",
FLOOR( (MOD(CLOSE_TIME - BEGINNING_TIME, 1) * 24) ) AS "시",
FLOOR( (MOD( (MOD(CLOSE_TIME - BEGINNING_TIME, 1
) * 24
), 1
) * 60
)
) AS "분"
FROM TEST_REGISTER;
SELECT FLOOR(CLOSE_TIME - BEGINNING_TIME) AS "일",
FLOOR( (MOD(CLOSE_TIME - BEGINNING_TIME, 1) * 24) ) AS "시",
FLOOR( (MOD( (MOD(CLOSE_TIME - BEGINNING_TIME, 1) * 24), 1) * 60) ) AS "분"
FROM TEST_REGISTER;
SELECT ER.*, TRUNC(ROUND(MOD((TO_DATE(ER.REPAIR_TO_TIME, 'HH24MISS') - TO_DATE(ER.REPAIR_FROM_TIME, 'HH24MISS'))*24*60,1)*60)) "sec"
FROM L_EQUIP_REPAIR ER
SELECT TRUNC(ROUND(MOD((date1-date2)*24*60,1)*60)) "sec"
FROM dual;
SELECT FLOOR(29)
FROM DUAL
'DATABASE' 카테고리의 다른 글
[MySQL] 외부접속 (0) | 2011.10.16 |
---|---|
[mySQL] RHEL5에서 mysql설치 (0) | 2011.10.16 |
[MySQL] Linux에서 5.0 설치하기 - 컴파일 (0) | 2011.10.16 |
[oracle] 10g에서 생긴 쓰레기통 삭제 방법 (0) | 2011.10.16 |
[oracle] 테이블정의서 만들기 쿼리 (0) | 2011.10.16 |