FROM nhanvien
WHERE n
hanvien_id BETWEEN 25 AND 100; The above example will return rows in the table if nhanvien_id is between 25 and 100 (including 25 and 100), equivalent to the SELECT statement below.
SELECT *
FROM nhanvien
WHERE nhanvien_id >= 25
AND nhanvien_i
d <= 100;
Example - with date
SELECT *
FROM nhanvien
WHERE n
gay_bat_dau BETWEEN '05/05/2014' AND '05/31/2014';
The above BETWEEN conditions return records from the table with the value immediately_bat_dau between May 1, 2014 and May 31, 2014 (including the first and last days). The above command is equivalent to the SELECT command below.
SELECT *
FROM nhanvien
WHERE ngay_bat_dau >= '2014/05/01'
AND ngay
_bat_dau <= '05/05/2014';
Example - NOT operator
SELECT *
FROM nhanvien
WHERE
nhanvien_id NOT BETWEEN 2000 AND 2999;
The SELECT statement returns rows from the table if nhanvien_id is not between 2000 and 2999, including the two end values, equivalent to the following command.
SELECT *
FROM nhanvien
WHERE nhanvien_id < 2000
OR nhan
vien_id> 2999;
Last lesson: JOIN in SQL Server
The following article: INSERT command in SQL Server