An in statement will be parsed identically to field=val1 or field=val2 or field=val3. Putting a null in there will boil down to field=null which won't work.

(Comment by Marc B)

I would do this for clairity

SELECT *
FROM tbl_name
WHERE 
(id_field IN ('value1', 'value2', 'value3') OR id_field IS NULL)
Answer from Daniel A. White on Stack Overflow
🌐
W3Schools
w3schools.com › sql › sql_null_values.asp
SQL NULL Values - IS NULL and IS NOT NULL
SQL Examples SQL Editor SQL Quiz SQL Exercises SQL Server SQL Syllabus SQL Study Plan SQL Training ... If a field in a table is optional, it is possible to insert or update a record without adding any value to this field. This way, the field ...
🌐
GeeksforGeeks
geeksforgeeks.org › sql › sql-null-values
NULL values in SQL - GeeksforGeeks
January 5, 2026 - A NULL value represents missing or undefined data. Since it is often not possible to determine which interpretation applies, SQL treats all NULL values as distinct and does not distinguish between them.
Discussions

SQL's NULL values are confusing – understanding how they work

A tricky one that catches me from time to time is the effect of a null in a subquery that you're doing "not in" operator on:

select a.* from A a where a.f1 not in (select b.f2 from B b where ...)

If the query for B produces any nulls, you'll always get no results from the query for A, regardless of the other content in A and B. That's because the query engine can't be sure any particular value is not in the list, because any null in the subquery is treated like an unknown that could stand for anything. So it returns null or false at each check of the not-in condition, and a null final result in a where clause won't have a record making it into the results, only positively true values would.

More on reddit.com
🌐 r/programming
5
1
June 19, 2017
Replace nulls values in sql using select statement in mysql? - Stack Overflow
Ho to do this? What query can be written by using select statement where all nulls should be replaced with 123? I know we can do this y using, update tablename set fieldname = "123" where fie... More on stackoverflow.com
🌐 stackoverflow.com
What is the best way to handle null in the aggregation function with the calculations?
Tip: You can use ISNULL(total_installment_amount,0) instead of that CASE statement for the sum aggregation I'm not quite sure what you mean for percentage calculation though. Are you trying to count records for a calculation? More on reddit.com
🌐 r/SQL
14
14
July 5, 2021
why am I having null in a sum in SQL?
Try this to ensure that the values are at least 0: COALESCE(column1,0) + COALESCE(column2,0) AS sum More on reddit.com
🌐 r/SQL
9
2
August 16, 2023
People also ask

What does IS NULL do in SQL?
IS NULL checks for cells that contain no data, letting you include or exclude rows with missing values. You write it as "WHERE column IS NULL" to find empty cells, or "IS NOT NULL" to skip them. A null cell holds no value at all, which is different from a blank space.
🌐
thoughtspot.com
thoughtspot.com › sql-tutorial › sql-is-null
SQL IS NULL | Basic SQL | ThoughtSpot
What is the difference between a null cell and an empty cell in SQL?
A null cell contains no data, while an empty or space-filled cell holds an actual value that just looks blank. Unlike Excel, SQL treats these two cases differently, so a space-filled cell won't match IS NULL. To catch both, combine IS NULL with a check like TRIM(column) = ''.
🌐
thoughtspot.com
thoughtspot.com › sql-tutorial › sql-is-null
SQL IS NULL | Basic SQL | ThoughtSpot
Why doesn't WHERE column = NULL work?
"WHERE column = NULL" doesn't work because you can't run a comparison or arithmetic against a null value. Since null represents the absence of data, SQL has nothing to compare against, so the condition never returns true. Use "IS NULL" instead, which is built for this exact check.
🌐
thoughtspot.com
thoughtspot.com › sql-tutorial › sql-is-null
SQL IS NULL | Basic SQL | ThoughtSpot
🌐
Metaplane
metaplane.dev › blog › best-ways-to-handle-null-values-in-sql
The 5 best ways to handle NULL values in SQL | Metaplane
They check each product's `reorder_point` value. Any time they encounter a NULL (meaning no reorder point has been set), they automatically substitute 10 as a safe default threshold. Remember that `ISNULL` and `IFNULL`aren't universally supported.
Find elsewhere
🌐
Medium
medium.com › @riat06 › behaviour-of-null-values-in-sql-48c18564c46
Behaviour of NULL values in SQL. How does null value affects different… | by Ria Thomas | Medium
August 30, 2024 - The behaviour of NULL is same for all of these functions except COUNT() and GROUP BY(). For the SQL aggregate functions, NULL values are not considered while the operation is performed i.e if AVG() is used on a set of values which have NULL as well average is calculated by ignoring it from the calculation. To show an example, I have a sample table here with a few values in MySQL.
🌐
DB Vis
dbvis.com › thetable › dealing-with-null-in-sql-complete-guide
Dealing With NULL in SQL: Complete Guide
April 9, 2025 - In SQL, NULL represents missing or unknown values in a database table. Unlike zero or an empty string, NULL signifies the absence of a value–not zero, not an empty string, but a true unknown or undefined value.
🌐
Hightouch
hightouch.com › sql-dictionary › sql-is-null
SQL IS NULL - Syntax, Use Cases, and Examples | Hightouch
December 29, 2023 - The SQL IS NULL operator is used to filter rows where a specified column's value is NULL. A NULL value in a database represents the absence of data, and the IS NULL operator is used to identify and select rows that contain NULL values in a ...
🌐
ThoughtSpot
thoughtspot.com › sql-tutorial › sql-is-null
SQL IS NULL | Basic SQL | ThoughtSpot
November 5, 2025 - This is covered in greater detail in the intermediate tutorial, but for now, here's what you need to know: You can select rows that contain no data in a given column by using IS NULL.
🌐
Enki
enki.com › post › understanding-null-values-in-sql
Enki | Blog - Understanding NULL Values in SQL
Unlike a zero value, which indicates a known absence, or an empty string, which represents a present but empty value, NULL signifies the absence of any data value. Proper handling of NULL values is crucial when performing various database operations such as comparisons, sorting, and aggregations.
🌐
W3Schools
w3schools.com › sql › sql_isnull.asp
W3Schools.com
COALESCE() - The preferred standard. (Works in MySQL, SQL Server and Oracle) ... Note: A NULL value represents an unknown or missing data in a database field.
🌐
Reddit
reddit.com › r › programming › comments › 6i6xfu › sqls_null_values_are_confusing_understanding_how
r/programming - SQL's NULL values are confusing – understanding how they work
June 19, 2017 - In a lot of cases we don't want the semantic meaning that NULL has, but we need to mark a field missing a value. Unfortunately, the only option for numeric, date and timestamp fields tends to be the NULL value rather than some more proper MISSING value.
🌐
Tutorialspoint
tutorialspoint.com › sql › sql-null-values.htm
SQL - NULL Values
SQL uses the term NULL to represent a non-existent data value in the database. These values are not the same as an empty string or a zero. They don't hold any space in the database and are used to signify the absence of a value or the unknown value
🌐
Medium
blog.dataengineerthings.org › demystify-null-values-in-sql-bc7e7e1b913a
Demystify NULL Values in SQL. What NULL really means in databases and… | by Xinran Waibel | Data Engineer Things
October 7, 2022 - In the SQL standard, NULL is a reserved keyword representing unknown or missing data values, following Codd’s 12 rules of RDBMS.
🌐
Mimo
mimo.org › glossary › sql › is-null
SQL IS NULL Condition: Syntax, Usage, and Examples
The SQL IS NULL condition helps you check if a column contains no value, meaning it's undefined or missing. In relational databases, NULL represents the absence of data, not zero or an empty string.
🌐
W3Schools
w3schools.com › mysql › mysql_null_values.asp
MySQL NULL Values - IS NULL and IS NOT NULL
Below is a selection from the "Customers" table in the Northwind sample database: The IS NULL operator is used to test for empty values (NULL values). The following SQL lists all customers with a NULL value in the "Address" field:
🌐
Regenerativetoday
regenerativetoday.com › handling-null-values-in-sql
Handling NULL values in SQL – Regenerative
August 19, 2019 - So to deal with NULL, we can use IS NULL or IS NOT NULL to check if there is a null value. Here is an example of IS NULL. Following query statement in the picture below querying for the rows where price column has null values from the fun table of inventory database.
🌐
Database Journal
databasejournal.com › home › features
Working with NULL Values in SQL | DatabaseJournal.com | Database Journal
March 9, 2023 - In relational databases and RDBMS’, NULL values are a special value in SQL that are used to represent an unknown – or in some instances, a missing – value in a column or cell.
🌐
DbSchema
dbschema.com › blog › tutorials › sql null values: is null, coalesce, nullif, and common pitfalls | dbschema
SQL NULL Values: IS NULL, COALESCE, NULLIF, and Common Pitfalls | DbSchema
August 22, 2023 - In MySQL, PostgreSQL, and SQL Server an empty string is a value that happens to have no characters, so it can be compared and two empty strings are equal. NULL is the absence of a value, so a comparison with it is UNKNOWN instead.