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
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
3 answers
0 votes
2 answers
0 votes
1 answer
asked Apr 2, 2021 in SQL by dev_sk2311 (45k points)
0 votes
1 answer

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...