Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone explain how to delete null values in SQL?

2 Answers

0 votes
by (119k points)

We can use the Null operator to check for null values in that particular column and delete those records using the DELETE command. Here is the SQL query to delete null values in SQL:

DELETE FROM Table_name

WHERE column_name  = ‘   ’

or

DELETE FROM Table_name

WHERE column_name  IS NULL

If you wish to learn SQL from top experts, I recommend enrolling in this SQL Course by Intellipaat that provides instructor-led training, and also certification.  

0 votes
ago by (1.5k points)

To delete all the null values in Sql, DELETE statement combined with WHERE clause will work.

Here’s the query that you can use:

DELETE FROM table_name

WHERE column_name IS NULL;

For multiple columns:

DELETE FROM table_name

WHERE column1 IS NULL OR column2 IS NULL;

Related questions

0 votes
2 answers
asked May 6, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer
0 votes
1 answer
asked Jul 20, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
asked May 1, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked Apr 28, 2020 in SQL by Sudhir_1997 (55.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...