First of all thanks for your help. I do an learning SQL, so I need some help.
I have a Sqlite database in which some fields in a certain column contains nothing or string of spaces.
Please How do I delete the rows containing nothing (or string of spaces) from the database?
Thanks for your help.
Try this:
DELETE FROM myTable WHERE myColumn IS NULL OR trim(myColumn) = '';
The trim()
is necessary so that strings containing just whitespace are collapsed to an empty string.
Try this:
DELETE FROM tbl
WHERE
(filed IS NULL OR filed = '')
Multiple Column:
DELETE FROM tbl
WHERE
(filed IS NULL OR filed = '')
AND (filed2 IS NULL OR filed2 = '')
AND (filed3 IS NULL OR filed2 = '')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With