You just want to retrieve the records whose Modifier (type VARCHAR2 (20) can be empty) is null from the database table EXPERT_DETAILS, because the field type is VARCHAR2 (20 ), the SQL statement I use is
Copy codeThe Code is as follows:
Select * from expert_details twhere t. modifier =''
No record is retrieved, which is inconsistent with the records stored in the table. Later I thought that even the empty volume storage should be NULL rather than ''in the database ''.
Then I used the following SQL statement and still did not retrieve a record.
Copy codeThe Code is as follows:
Select * from expert_details t
Where t. modifier = null
Finally, I thought of testing the NULL value in SQL. Use the following statement to finally retrieve the desired result.
Copy codeThe Code is as follows:
Select * from expert_details t
Where t. modifier is null
In SQL statements, where clause: where t. modifier = null. The NULL keyword cannot be used here because it is not a real value. It is just a symbol because its value is unknown. When t. when modifier itself is null, that is, the where clause is: where null = null. When the values on both sides of the equal sign are unknown, the result is TRUE or FALSE. SQL cannot provide a clear result, therefore, the query result is NULL.
Therefore, the NULL value test must be explicitly used, that IS, the field is null or its negative form field is not null, to detect the NULL value.