oracle 相差小时数

select ceil(((To_date('2008-05-02 00:00:00' , 'yyyy-mm-dd hh24-mi-ss') -
To_date('2008-04-30 23:59:59' , 'yyyy-mm-dd hh24-mi-ss'))) * 24 * 60)  相差分钟数 FROM DUAL;

select ceil((To_date('20080501000000' , 'yyyymmddhh24miss') -
To_date('20080430235959' , 'yyyymmddhh24miss')) * 24)  相差小时数 FROM DUAL;


select  ROUND(TO_NUMBER(To_date('20080501000000' , 'yyyymmddhh24miss') -
To_date('20080430235959' , 'yyyymmddhh24miss')) * 24) 相差小时数 FROM DUAL;

select count(*) from DZBLPJ.ZY_Lab_CLOSED_CYCLE where
ROUND(TO_NUMBER(To_date(CRITICAL_VALUE_RECIVE_TIME , 'yyyymmddhh24miss') -
To_date(CRITICAL_VALUE_SEND_TIME , 'yyyymmddhh24miss')) *  24*60) <=20
;

select count(*) from DZBLPJ.ZY_Lab_CLOSED_CYCLE where
ROUND(TO_NUMBER(To_date(CRITICAL_VALUE_DEAL_TIME , 'yyyymmddhh24miss') -
To_date(CRITICAL_VALUE_SEND_TIME , 'yyyymmddhh24miss')) *  24) <=2
;

select ROUND(TO_NUMBER(To_date(CRITICAL_VALUE_DEAL_TIME , 'yyyymmddhh24miss') -
To_date(CRITICAL_VALUE_SEND_TIME , 'yyyymmddhh24miss')) *  24*60)
from DZBLPJ.ZY_Lab_CLOSED_CYCLE;
posted @ 2021-01-15 14:18  剑小新  阅读(115)  评论(0编辑  收藏  举报