select TO_DATE('20191206240000', 'yyyy-mm-dd hh24:mi:ss') from dual
> ORA-01861: literal does not match format string
字符串时间为24点时,oracle的函数级别是无解了,时间格式里,hh24的小时只能是0到23,所以换种写法吧。
SELECT
decode(substr('20191206240000', 9, 2 ),24, to_char(to_date(substr( '20191206240000', 1, 8 ), 'yyyyMMdd') + 1,'yyyymmdd') || '000000','20191206240000')
FROM dual;