The database reports an ORA-01839 Error
The ZCGL database reports that the date of the month specified by the ORA-01839 is invalid when running the SQL statement
The detailed SQL statement is simplified as follows:
Select *
From table_name
Where to_date (a. yc_date, 'yyyy-mm-dd')-sysdate> 1
[Cause of problem] The ORA-01839 indicates that the date of the result set of z_yc_date does not meet the corresponding date standard.
Select to_date ('2014/1/31', 'yyyy/mm/dd') from dual;
Because February No 31, so it will be reported ORA-01839 error;
[Solution] There are two solutions to this error:
1. Find out the date that does not conform to the specification in the source data (the result set has been exported but no obvious error has been found );
2. Rewrite the corresponding SQL statement as follows:
Select * from table_name
Where ya. c_date> = to_char (sysdate, 'yyyy-mm-dd') # compare data by using the struct
[Summary] the above problems can be avoided during table creation. We recommend that you store the columns of time and date. We recommend that you set the column type to date when creating the table, it is of great benefit to subsequent management and performance;