Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7622853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:33:30+00:00 2026-05-31T04:33:30+00:00

Possible Duplicate: what is “=null” and “ IS NULL” Is there any difference between

  • 0

Possible Duplicate:
what is “=null” and “ IS NULL”
Is there any difference between IS NULL and =NULL

What is the difference between

where x is null

and

where x = null

and why does the latter not work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:33:32+00:00Added an answer on May 31, 2026 at 4:33 am

    In SQL, a comparison between a null value and any other value (including another null) using a comparison operator (eg =, !=, <, etc) will result in a null, which is considered as false for the purposes of a where clause (strictly speaking, it’s “not true”, rather than “false”, but the effect is the same).

    The reasoning is that a null means “unknown”, so the result of any comparison to a null is also “unknown”. So you’ll get no hit on rows by coding where my_column = null.

    SQL provides the special syntax for testing if a column is null, via is null and is not null, which is a special condition to test for a null (or not a null).

    Here’s some SQL showing a variety of conditions and and their effect as per above.

    create table t (x int, y int);
    insert into t values (null, null), (null, 1), (1, 1);
    
    select 'x = null' as test , x, y from t where x = null
    union all
    select 'x != null', x, y from t where x != null
    union all
    select 'not (x = null)', x, y from t where not (x = null)
    union all
    select 'x = y', x, y from t where x = y
    union all
    select 'not (x = y)', x, y from t where not (x = y);
    

    returns only 1 row (as expected):

    TEST    X   Y
    x = y   1   1
    

    See this running on SQLFiddle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: C++: “std::endl” vs “n” I'm wondering if there is any significant difference
Possible Duplicate: Is there an “opposite” to the null coalescing operator? (…in any language?)
Possible Duplicate: ASP.NET “special” tags What is the difference between <%# ... %> ,
Possible Duplicate: What is the difference between String.Empty and “” Is equivalent to String.Empty
Possible Duplicate: C# newbie: what’s the difference between “bool” and “bool?” ? Hi, While
Possible Duplicate: Why does one often see “null != variable” instead of “variable !=
Possible Duplicate: mySQL “Rank in Highscore”-Query I was just wondering if there is any
Possible Duplicate: “NOT IN” clause in LINQ to Entities I work with the schema
Possible Duplicate: Why does one often see “null != variable” instead of “variable !=
Possible Duplicate: “Web interface” to PHPUnit tests? Are there any PHP unit testing systems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.