How to delete the rows, where data is null?

As per the query, the row from 1 to 11 should be deleted, but didn't. What is the reason?

select * from tblPerson;   
delete from tblPerson where Age = NULL

screenshot

Upvotes: 1

Views: 804

Answers (1)

Madhukar
Madhukar

Reputation: 1242

This should work

DELETE FROM tblPerson WHERE Age IS NULL

Age IS NULL checks whether Age is a NULL value.

Age = NULL is checking whether Age is equal to NULL which will never be true.

Upvotes: 4

Related Questions