0
I have a table of files, and in it there is a field called "document type", which is filled with 1 or when it is not filled is NULL, the problem is that when I give a SELECT
and use the comparator to return all results with document type other than 1 (AND tipo_documento <> 1)
, data that has NULL is not returned, because this occurs?
The way I found to get around it was like this:
AND tipo_documento <> 1 OR tipo_documento IS NULL
The NULL value means that the data value for the column is unknown. An unknown value cannot be compared with another value. Use the IS NULL or IS NOT NULL clauses to test a NULL value.
– user60252