Languages

MySQL - select only rows where removal_time is NULL

3 points
Asked by:
Root-ssh
178290

How to select only rows where removal_time is NULL with MySQL?

Doesn't work:

It can be executed, but it doens't return any values at all - NULL or NOT NULL.
How to make it work?

 

1 answer
1 points
Answered by:
Root-ssh
178290

Correct SQL:

Where we want to select rows with only NULL values:

And if we want to select rows with NOT NULL values:

Eg:

Is is very common mistake and a lot of people try to use:

  • = NULL
  • != NULL
0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join