FROM nhanvien
WHERE ho IS NULL;
This example will return all records in the table if the employee's last name is left blank - or called NULL.
Example - INSERT command
INSERT INTO nhanvien
((nhanvien_id, ho, ten)
SELECT nhanvien_id, ho, ten
FROM danhba
WHERE ten IS NULL;
This command will fill in records from the list into the user table in the fields whose employee name is left blank.
Example - UPDATE command
UPDATE nhanvien
SET ten = 'Unknown'
WHERE ten IS NULL;
In this example, the records in the user table whose blank name value will be updated.
Example - DELETE command
DELETE FROM nhanvien
WHERE ho IS NULL;
This command will delete all records in the table if the value in the last name field is NULL.
Previous article: IN conditions in SQL Server
Next lesson: IS NOT NULL condition in SQL Server