Just wanted to retrieve those records from the table expert_details in the database whose modifier (type VARCHAR2 (20), nullable) are empty because the field is of type VARCHAR2 (20), and the SQL statement I use is
Copy Code code as follows:
SELECT * from expert_details twhere t.modifier = '
A record was not retrieved, which does not match the records stored in the table. It was later thought that even a null-character store in a database should be null instead of '.
I then used the following SQL statement and still did not retrieve a single record.
Copy Code code as follows:
SELECT * FROM Expert_details t
where t.modifier = null
Finally I thought of the null value test in SQL. Use the following statement to finally retrieve the desired result.
Copy Code code as follows:
SELECT * FROM Expert_details t
where t.modifier is null
In the SQL statement, WHERE clause: where t.modifier = null, the NULL keyword cannot be used here because it is not a true value, it is just a symbol because its value is unknown. When the t.modifier itself is NULL, the WHERE clause is: where null= null, when the values on both sides of the equals sign are unknown, the result is true or false,sql cannot give a definite result, so the result of the query is null.
Therefore, it is necessary to explicitly use a null value test that is null or a negative form field is not NULL to detect null values.