SQL Between

« Previous Tutorial Next Tutorial »

SQL BETWEEN operator is basically used to select the values within a range. The values can be text, numbers, or dates. Here is the general form of the BETWEEN operator in SQL:

SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;

SQL BETWEEN Operator Example

Here is an example of BETWEEN operator in SQL. Consider the following table CUSTOMERS having the records:

sql between

The following SQL statement selects all the columns of the table CUSTOMERS whose salary in between 76000 and 86000:

SELECT * FROM customers
WHERE salary BETWEEN 76000 AND 86000;

After querying the above SQL statements, you will get the following output:

sql between operator

« Previous Tutorial Next Tutorial »


Quick Links
Signup - Login - Give Online Test