Where Between
The BETWEEN operator selects values within a given range. The between operator is similar to >= AND <=.
SQL Where BETWEEN Syntax:
SELECT Column1
FROM Table_Name
WHERE Column1 BETWEEN value1 AND value2;
Example:
Lets use the “Orders” table to find all orders placed in the month of September.
Results:
The NOT Operator can also be used to include all values outside of the selected range while excluding the values in that selected range.
SQL Where NOT BETWEEN Syntax:
SELECT Column1
FROM Table_Name
WHERE Column1 NOT BETWEEN value1 AND value2;
Example:
Lets use the “Customers” table to exclude all customers whose first name begins with the letters in the range of “N” to “V”.
Results:
SQL Tutorial