# How do SQL NULL values affect filters and comparisons?

Canonical URL: https://help.iagenify.com/faqs/databases/how-do-sql-null-values-affect-filters-and-comparisons

[← Back to Databases FAQs](https://help.iagenify.com/faqs/databases)

HELP CENTER · FAQ Databases 1 min read
# How do SQL NULL values affect filters and comparisons?
NULL represents an unknown or missing value in SQL, so ordinary equality checks do not match it. Use IS NULL or IS NOT NULL to test for its presence, and decide explicitly how missing values should affect the result.
IaGenify
Databases

## Use the correct predicate
A condition such as column = NULL does not evaluate as a normal true comparison. SQL uses three-valued logic, so a comparison involving NULL is unknown and is typically excluded by a WHERE clause.
Use IS NULL to select rows whose field is missing and IS NOT NULL to select rows with a value. For parameters that may be null, build the condition deliberately rather than expecting equality to handle both cases automatically.
## Define how missing data should behave
Decide whether an absent value should be excluded, treated as a default, or reported separately. COALESCE can provide a fallback expression for display or calculation, but the chosen default should reflect the meaning of the field.
Test filters with rows containing NULL, empty strings, and ordinary values; these are not interchangeable. Review aggregates too, since many SQL aggregate functions skip NULL values, which can change counts or averages. [← Back to Databases FAQs](https://help.iagenify.com/faqs/databases)
