Oracle ORA-01861: error text and format string does not match

Database field DATATIME type, query need to format the query field, using Oracle's to_date function

SQL read:

select t.*, t.rowid from LOGISTICS_ORDER t where t.order_date > to_date('2017-1-1', 'yyyy-mm-dd');

If the database is stored in the time format is not the same, then the query must first conditional formatting, use to_char, to_date function

to_date(to_char(time, 'yyyy-MM-dd'), 'yyyy-mm-dd');

 

Guess you like

Origin blog.csdn.net/m0_37787662/article/details/87206452