结果.rarSELECTtmp.开始,tmp.结束,tmp.减小时与不减,tmp.OT_MINUTE,tmp.OT_HOURS,tmp.MEMBER_NAME,tmp.DEPARTMENT_NAME,CASEWHEN instr(tmp.减小时与不减, '.')= 0 THEN tmp.减小时与不减WHEN substr(tmp.减小时与不减, instr(tmp.减小时与不减, '.')+ 1, 1)* 1 >= 5 THEN substr(tmp.减小时与不减, 1, instr(tmp.减小时与不减, '.')-1)+ 0.5ELSE substr(tmp.减小时与不减, 1 , instr(tmp.减小时与不减, '.')-1)+ 0END AS 判断FROM(SELECTt.开始,t.结束,round((t.结束-t.开始)* 24-1) AS 小时,t.OT_MINUTE,t.OT_HOURS,t.MEMBER_NAME,t.DEPARTMENT_NAME, CASEWHEN to_char(t.开始, 'HH24')* 1 <= 11AND to_char(t.结束, 'HH24')* 1 >= 13 THEN (t.结束-t.开始)* 24-1ELSE (t.结束-t.开始)* 24END AS 减小时与不减FROM(SELECTS.OT_START_DATETIME / (1000 * 60 * 60 * 24)+ TO_DATE('1970-01-01 08:00:00', 'YYYY-MM-DD HH24:MI:SS') AS 开始,S.OT_END_DATETIME / (1000 * 60 * 60 * 24)+ TO_DATE('1970-01-01 08:00:00', 'YYYY-MM-DD HH24:MI:SS') AS 结束,S.OVERTIME_TYPE,S.OT_MINUTE,S.OT_HOURS,M.MEMBER_NAME,M.DEPARTMENT_NAMEFROMV3XUSER.ATT_OVERTIME_DETAILS SLEFT JOIN V3XUSER.ATT_MEMBER M ONS.MEMBER_ID = M.MEMBER_ID) t) tmporacle的在DBeaver上导出SQL查询可以正常运行 在导出的时候报错substr(tmp.减小时与不减, 1 , instr(tmp.减小时与不减, '.')-1)+ 0这一句开始报错SQL 错误 : ORA-01722: 无效数字