ShareThis

Sunday, April 15, 2012

SQL How to delete null records

Most people try something like this:

DELETE FROM tableName
WHERE columnName = NULL


That is wrong! Use this:


DELETE FROM tableName
WHERE columnName IS NULL

You can verify by doing "select * from columnName" to see the updated column.



0 comments:

Post a Comment