How to update column with null value
No special syntax:
CREATE TABLE your_table (some_id int, your_column varchar(100));
INSERT INTO your_table VALUES (1, 'Hello');
UPDATE your_table
SET your_column = NULL
WHERE some_id = 1;
SELECT * FROM your_table WHERE your_column IS NULL;
+---------+-------------+
| some_id | your_column |
+---------+-------------+
| 1 | NULL |
+---------+-------------+
1 row in set (0.00 sec)
Use IS
instead of =
This will solve your problem
example syntax:
UPDATE studentdetails
SET contactnumber = 9098979690
WHERE contactnumber IS NULL;
NULL
is a special value in SQL. So to null a property, do this:
UPDATE table SET column = NULL;