There is no difference.

It seems to me that there might be a difference when it comes to performance. Anyone care to elaborate on this?

All major engines (that is MySQL, SQL Server, Oracle and PostgreSQL) will merge these predicates on parsing stage, making identical plans from them.

Handling of these conditions is more complex that mere applying operators in one or another order.

For instance, in Oracle, an IS NOT NULL (or NOT IS NULL) condition implies a possibility to use an index, so a query like this:

SELECT  column
FROM    mytable
WHERE   column IS NOT NULL

will most probably be executed with an index fast full scan, with no additional checks made in runtime (since the NULL values just won't make it into the index, so it's no use to check them).

Even if each record would need to be checked, the order of checks will be defined by the optimizer (and not by the order the predicates and operators appear in the WHERE clause).

For instance, here is a plan for an Oracle query:

SQL> EXPLAIN PLAN FOR
  2  
  2  SELECT *
  3  FROM   t_test
  4  WHERE  NOT column IS NULL
  5  /

Explained

SQL> SELECT  *
  2  FROM    TABLE(DBMS_XPLAN.display())
  3  /

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 958699830
----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |    30 |  1260 |     3   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| T_TEST |    30 |  1260 |     3   (0)| 00:00:01 |
----------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter("COLUMN" IS NOT NULL)

As you can see, the filter was translated internally into an IS NOT NULL (which Oracle along with most commenters seems to believe to be a more appropriate form)

Update:

As Jonathan Leffler pointed out, these is difference when evaluating tuples (as opposed to single columns).

A tuple consisting of mixed NULL and non-NULL values is neither a NULL nor a NOT NULL.

In PostgreSQL (which supports this predicate against tuples), both these expressions:

SELECT  (1, NULL) IS NULL
SELECT  (1, NULL) IS NOT NULL

evaluate to false.

Answer from Quassnoi on Stack Overflow
🌐
W3Schools
w3schools.com › sql › sql_null_values.asp
SQL NULL Values - IS NULL and IS NOT NULL
Tip: Always use IS NULL to look for NULL values. The IS NOT NULL operator is used to test for non-empty values (NOT NULL values).
🌐
Reddit
reddit.com › r/sql › need some knowledge on null and not null
r/SQL on Reddit: Need some knowledge on NULL and NOT NULL
December 22, 2021 -
  • Where and why exactly a null is used?

  • What is exactly null and not null? To my understanding Not null we use when its mandatory to insert some value in that field, also when we give check constraint so by default the column will be not null right?

  • By adding new column through alter method default values are null, so how would I be able to insert values in it and is it right to give not null constraint to that new column while adding through alter method, basically when null and when not null to be used?...

god this is so confusing please help me, ik im asking alot but im really confused

Discussions

sql - What is the difference between "Is Not Null" and "Not Is Null" - Stack Overflow
SELECT id FROM customers WHERE type IS NOT Null; Versus: SELECT id FROM customers WHERE NOT type IS NULL; The data that either of the above will return will be exactly the same. What is the diffe... More on stackoverflow.com
🌐 stackoverflow.com
sql server - CASE statement with IS NULL and NOT NULL - Database Administrators Stack Exchange
Is there any better way to write the lines below in SQL Server 2005? CASE WHEN (ID IS NULL) THEN 'YES' WHEN (ID IS NOT NULL) THEN 'NO' END AS ID_Value, More on dba.stackexchange.com
🌐 dba.stackexchange.com
July 10, 2012
GSheet Query - how to add 'IS NOT NULL'? - Google Docs Editors Community
Skip to main content · Google Docs Editors Help · Sign in · Google Help · Help Center · Community · Google Docs Editors · Terms of Service · Submit feedback · Send feedback on More on support.google.com
🌐 support.google.com
June 14, 2022
sql - MySQL SELECT only not null values - Stack Overflow
Is it possible to do a select statement that takes only NOT NULL values? Right now I am using this: SELECT * FROM table And then I have to filter out the null values with a php loop. Is there a ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Hightouch
hightouch.com › sql-dictionary › sql-is-not-null
SQL IS NOT NULL - Syntax, Use Cases, and Examples | Hightouch
December 29, 2023 - The SQL IS NOT NULL operator is used to filter rows in a database table where a specified column's value is not NULL. It is the opposite of the IS NULL operator.
🌐
Mimo
mimo.org › glossary › sql › is-not-null
SQL IS NOT NULL Condition: Syntax, Usage, and Examples
SELECT name, ISNULL(phone_number, 'Not Provided') AS contact_number FROM customers WHERE phone_number IS NOT NULL; This retrieves rows with phone numbers and replaces any potential null display with a default string. The same pattern also works in MySQL, although the helper functions around null handling may differ between systems. You can use IS NOT NULL inside CASE expressions to show different results based on whether a column has a value:
🌐
Oracle
docs.oracle.com › en › database › other-databases › nosql-database › 25.3 › sqlreferencefornosql › is-null-and-is-not-null-operators.html
IS NULL and IS NOT NULL Operators
February 6, 2026 - If the input expression returns more than one item, an error is raised. If the result of the input expression is empty, IS NULL returns false. Otherwise, IS NULL returns true if and only if the single item computed by the input expression is NULL. The IS NOT NULL operator is equivalent to NOT ...
Find elsewhere
Top answer
1 of 3
34

There is no difference.

It seems to me that there might be a difference when it comes to performance. Anyone care to elaborate on this?

All major engines (that is MySQL, SQL Server, Oracle and PostgreSQL) will merge these predicates on parsing stage, making identical plans from them.

Handling of these conditions is more complex that mere applying operators in one or another order.

For instance, in Oracle, an IS NOT NULL (or NOT IS NULL) condition implies a possibility to use an index, so a query like this:

SELECT  column
FROM    mytable
WHERE   column IS NOT NULL

will most probably be executed with an index fast full scan, with no additional checks made in runtime (since the NULL values just won't make it into the index, so it's no use to check them).

Even if each record would need to be checked, the order of checks will be defined by the optimizer (and not by the order the predicates and operators appear in the WHERE clause).

For instance, here is a plan for an Oracle query:

SQL> EXPLAIN PLAN FOR
  2  
  2  SELECT *
  3  FROM   t_test
  4  WHERE  NOT column IS NULL
  5  /

Explained

SQL> SELECT  *
  2  FROM    TABLE(DBMS_XPLAN.display())
  3  /

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 958699830
----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |    30 |  1260 |     3   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| T_TEST |    30 |  1260 |     3   (0)| 00:00:01 |
----------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter("COLUMN" IS NOT NULL)

As you can see, the filter was translated internally into an IS NOT NULL (which Oracle along with most commenters seems to believe to be a more appropriate form)

Update:

As Jonathan Leffler pointed out, these is difference when evaluating tuples (as opposed to single columns).

A tuple consisting of mixed NULL and non-NULL values is neither a NULL nor a NOT NULL.

In PostgreSQL (which supports this predicate against tuples), both these expressions:

SELECT  (1, NULL) IS NULL
SELECT  (1, NULL) IS NOT NULL

evaluate to false.

2 of 3
18

IS NOT NULL is a comparison operator, just like IS NULL or =, >, <, etc.

NOT is a logical operator that acts on the rest of the condition. So you can say NOT type = 5, NOT type IS NULL, or even NOT type IS NOT NULL.

My point here is to point out that they are two very different operators, even though the result is the same. Of course, in boolean logic, there is no difference between NOT (column IS NULL) and column IS NOT NULL, but it's wise to know the difference.

As for performance, IS NOT NULL might save you a few cycles over NOT ... IS NULL because you are using a single operator instead of two operators, but any reasonable optimizer will figure out they are the same thing before the query is run.

🌐
Reintech
reintech.io › blog › understanding-sql-is-null-and-is-not-null-operators
SQL 'IS NULL' & 'IS NOT NULL' Operators | Reintech media
February 20, 2026 - Data validation: Find incomplete ... it causes issues · The IS NOT NULL operator does the opposite—it returns rows where a column does contain a value....
🌐
Programiz
programiz.com › sql › is-null-not-null
SQL IS NULL and IS NOT NULL (With Examples)
In SQL, IS NULL and IS NOT NULL are used to check if a column in a table contains a NULL value or not.
🌐
TypeScript
typescriptlang.org › docs › handbook › 2 › everyday-types.html
TypeScript: Documentation - Everyday Types
TypeScript also has a special syntax for removing null and undefined from a type without doing any explicit checking. Writing ! after any expression is effectively a type assertion that the value isn’t null or undefined:
🌐
7-Zip Documentation
documentation.help › tsqlref › ts_ia-iz_9wfg.htm
IS [NOT] NULL - Transact-SQL Reference Documentation
If the value of expression is NULL, IS NOT NULL returns FALSE; otherwise, it returns TRUE.
🌐
PostgreSQL
postgresql.org › docs › current › datatype-numeric.html
PostgreSQL: Documentation: 18: 8.1. Numeric Types
1 month ago - Thus, we have created an integer column and arranged for its default values to be assigned from a sequence generator. A NOT NULL constraint is applied to ensure that a null value cannot be inserted.
🌐
Snowflake Documentation
docs.snowflake.com › en › sql-reference › functions › is-null
IS [ NOT ] NULL | Snowflake Documentation
When IS NULL is specified, the value is TRUE if the expression is NULL. Otherwise, returns FALSE. When IS NOT NULL is specified, the value is TRUE if the expression is not NULL.
🌐
Axiom
axiom.co › docs › apl › scalar-functions › string-functions › isnotnull
Axiom Docs
isnull: Returns true if a value is null. Use this for the inverse check of isnotnull. isnotempty: Checks if a value is not empty and not null.
🌐
Google Support
support.google.com › docs › thread › 167316921 › gsheet-query-how-to-add-is-not-null
GSheet Query - how to add 'IS NOT NULL'? - Google Docs Editors Community
June 14, 2022 - Skip to main content · Google Docs Editors Help · Sign in · Google Help · Help Center · Community · Google Docs Editors · Terms of Service · Submit feedback · Send feedback on
🌐
DB Vis
dbvis.com › thetable › sql-is-not-null-condition-definitive-guide
SQL IS NOT NULL Condition: Definitive Guide
August 13, 2025 - This checks whether the SQL expression (a column, hardcoded value, or other type of expression) is a NULL value. If the value of the expression holds NULL, the condition returns false. If it does not hold NULL, it returns true.
🌐
Medium
medium.com › @roscoe.kerby › sql-exploring-the-difference-between-null-and-is-not-null-33602745e60e
SQL: Exploring the Difference Between “!= NULL” and “IS NOT NULL” | by Roscoe Kerby [ROSCODE] | Medium
September 26, 2023 - In SQL, comparisons with NULL typically result in an unknown or NULL result. ... On the other hand, “IS NOT NULL” is a specific operator designed explicitly for checking whether a column contains non-NULL values.
Top answer
1 of 12
542

You should use IS NOT NULL. (The comparison operators = and <> both give UNKNOWN with NULL on either side of the expression.)

SELECT * 
FROM table 
WHERE YourColumn IS NOT NULL;

Just for completeness I'll mention that in MySQL you can also negate the null safe equality operator but this is not standard SQL.

SELECT *
FROM table 
WHERE NOT (YourColumn <=> NULL);

Edited to reflect comments. It sounds like your table may not be in first normal form in which case changing the structure may make your task easier. A couple of other ways of doing it though...

SELECT val1 AS val
FROM  your_table
WHERE val1 IS NOT NULL
UNION ALL
SELECT val2 
FROM  your_table
WHERE val2 IS NOT NULL
/*And so on for all your columns*/

The disadvantage of the above is that it scans the table multiple times once for each column. That may possibly be avoided by the below but I haven't tested this in MySQL.

SELECT CASE idx
         WHEN 1 THEN val1
         WHEN 2 THEN val2
       END AS val
FROM   your_table
        /*CROSS JOIN*/
       JOIN (SELECT 1 AS idx
                   UNION ALL
                   SELECT 2) t
HAVING val IS NOT NULL  /*Can reference alias in Having in MySQL*/
2 of 12
25

You can filter out rows that contain a NULL value in a specific column:

SELECT col1, col2, ..., coln
FROM yourtable
WHERE somecolumn IS NOT NULL

If you want to filter out rows that contain a null in any column then try this:

SELECT col1, col2, ..., coln
FROM yourtable
WHERE col1 IS NOT NULL
AND col2 IS NOT NULL
-- ...
AND coln IS NOT NULL

Update: Based on your comments, perhaps you want this?

SELECT * FROM
(
    SELECT col1 AS col FROM yourtable
    UNION
    SELECT col2 AS col FROM yourtable
    UNION
    -- ...
    UNION
    SELECT coln AS col FROM yourtable
) T1
WHERE col IS NOT NULL

And I agre with Martin that if you need to do this then you should probably change your database design.