FROM nhanvien
WHERE ho IS NOT NULL;
This example returns all records from the user table whose employee information field contains no NULL values (not left blank).
Example - INSERT command
INSERT INTO danhba
(danhba_id, ho, ten)
SELECT nhanvien_id, ho, ten
FROM nhanvien
WHERE ho IS NOT N
ULL;
This command will insert the record into the namba table if the employee's last name in the table is not NULL.
Example - UPDATE command
UPDATE nhanvien
SET tinhtrang = 'Active'
WHERE ho IS NOT NULL;
The records in the table that have them are not NULL values will be updated.
Example - DELETE command
DELETE FROM nhanvien
WHERE tinhtrang IS NOT NULL;
In this example, all records from the table have a 'status' information field that does not contain a NULL value that will be deleted.
Previous article: IS NULL condition in SQL Server
Next article: Condition LIKE in SQL Server