CREATE TABLE mxm_test04
(mxm_id NUMBER ,mxm_date1 DATE,mxm_date2 DATE) ;
INSERT INTO mxm_test04 VALUES(1,to_date('20100813 07:22:23','yyyymmdd hh24:mi:ss'),to_date('20100812 09:22:23','yyyymmdd hh24:mi:ss'));
INSERT INTO mxm_test04 VALUES(2,to_date('20100813 09:22:23','yyyymmdd hh24:mi:ss'),to_date('20100812 09:22:23','yyyymmdd hh24:mi:ss'));
COMMIT;
SELECT * FROM mxm_test04 ;
SELECT mxm_date1 - mxm_date2 FROM mxm_test04 WHERE mxm_id = 1;
结果 :0.916666666666667
SELECT mxm_date1 - mxm_date2 FROM mxm_test04 WHERE mxm_id = 2;
结果 :1
结论:oracle中时间相减得出的结果是相差多少天,而不是相差多少小时。
相加表示加上多少天,而不是小时。
今天这个问题找原因,浪费了一点时间