Project scenario:
This project is an old one, which is outsourced. As a result, many parts of the development do not pay much attention to the details. There is a field of date type that is designed as integer, which is easy to cause some strange problems.
Problem Description:
In the process of development, I encountered an SQL error in the execution of “invalid month”. I checked the submission record of this file and found that the file was last modified half a year ago, indicating that it was not a SQL problem. That’s the data problem.
Cause analysis:
Preliminary analysis of this issue should date, because there is a function to in SQL_ Date (), most likely a data format.
After putting all the LR_ After replacing the date field with null, we find that SQL can find out the data, which further verifies our conjecture. It’s about the date.
First of all, we suspect that there may be a very large number or a very small number in the date field, but we find that it is not.
And then I fell into meditation.
For example, in December, I doubt whether there will be any unconventional data in this field.
In order to verify this conjecture, we use substr (a, 6, 2) to cut the field, intercept the month, and find out the data of substr (a, 6, 2) & gt; 12.
Finally, find the problem. There is a data 20211301, which leads to this problem.
Solution:
Change the date of abnormal data to normal value.
Read More:
- In the SQL query statement, add the column that does not exist in the table and set the fixed value of the column
- Elasticsearch6. X invalid time range query bug
- Invalid bound statement (not found) of custom SQL in mybatisplus
- SQL query time group_ Was cut by group_ CONCAT()
- Solution to the problem that SQL database query result field contains new line character, which leads to copy to excel dislocation
- ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS sqlState
- Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the
- This function has none of deterministic, no SQL, or reads SQL data in its error records
- SQL error: 17006, sqlstate: 99999 invalid column name
- MongoDB Error: Query failed with error code 2 and error message ‘Field ‘locale’ is invalid
- Cause: java.sql.SQLException: invalid column type: 1111 Error [How to Fix]
- [solved] sql30082n security processing failed with reason “24” (“user name and / or password invalid”)
- Error querying database.Cause:java.sql.SQLSyntaxErrorException:ORA-00911:invalid character
- “No nodes available to run query” is reported when using Presto to connect to MySQL query“
- Two ways of fuzzy query in mybatis
- PHP Fatal error: Call to a member function query() on a non-object in
- Mybatis integrates Oracle query and reports an error in the datetime type field
- A convenient method to count the total number of query results in MySQL
- Usage of NVL in SQL
- Linux_ day07_ 05_ Configure common add, delete, modify and query commands in network