select “TO_DATE”(‘2023/02/02 00:00:00’, ‘yyyy/mm/dd’) from dual
报错ORA-01830: date format picture ends before converting entire input string
错误产生原因:date类型不能包含秒以后的精度。
2023-02-02 17:50:20
在使用to_date() 函数时有可能出现此错误
解决办法:
to_date(‘2023-02-02 17:50:20’,‘yyyy-mm-dd’)
是错误的
使用instr() 函数配合使用,例如:
to_date( substr('2022-02-02 00:00:00',0,INSTR('2022-02-02 00:00:00', ':', 1, 1)-3),'yyyy-mm-dd')
是正确的