Reputation: 285
I have a person table in SQL and i have columns: id, lastname, firstname, address, city. City for a person is empty so i want a query to delete the row containing the person with a blank city column value. The code below didn't do it even though no errors were raised.
DELETE FROM persons pers
WHERE lastname = 'saire' AND address = 'NULL'
Upvotes: 0
Views: 12677
Reputation: 2402
The following SQL command should remove all records with a null value for city. Try this.
DELETE FROM persons
where city IS NULL
Upvotes: 2