How to Use BETWEEN Correctly

The BETWEEN clause is used to validate if a value is in a range. For example

Select * from employee where salary between 45000 and 60000;

Is equivalent to:

Select * from employee where salary >= 45000 and salary <= 60000;

Between can be used with columns/expression of data type like integer, decimal, date, timestamp or any data type supporting the > and < comparison operators.

IN THIS PAGE