Languages

MySQL - Why I can't delete row where column is NULL?

4 points
Asked by:
Root-ssh
94100

I use MySQL and I have a problem with my query.

My query:

DELETE FROM users WHERE user_address = NULL;

Why I can't delete row where column is NULL?

I don't get any errors from database and data is not removed after I execute the above query.

1 answer
2 points
Answered by:
Root-ssh
94100

Quick solution:

DELETE FROM users WHERE user_address IS NULL;

Sometimes your data can be empty string. You can delete row with below query:

DELETE FROM users WHERE user_address = '';

 

0 comments Add comment
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