The BETWEEN operator is used to specify a range of data you want to test your result set against. The BETWEEN operator is frequently used with the WHERE clause and any of the following statements:

The following example shows a basic syntax using BETWEEN operator:


SELECT|INSERT|UPDATE|DELETE * WHERE (NOT) BETWEEN begin_expression AND end_expression;

A simple real world example, than, would look like this:

SELECT * FROM Emp WHERE salary BETWEEN 10000 AND 20000;

Obviously, this query will list all the employees having salary from 10000 to 20000. The * is a wildcard for everything.