Skip to the content.
< PREVIOUS   NEXT>

BETWEEN OPERATOR

The BETWEEN operator selects values within a given range. The values can be numbers, text, or dates.

The BETWEEN operator is inclusive: begin and end values are included.

SYNTAX

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

EXAMPLE

Suppose there is a Table name as “HrEmployee” having Age, Attrition, BusinessTravel, DailyRate, Department, DistanceFromHome, Education, EducationField columns, EmployeeNumber, etc as Columns.





We can also add text value in range of Between, ex: str1 BETWEEN str2.


We can add date also in range, ex: BETWEEN ‘1996-07-01’ AND ‘1996-07-31’.


< PREVIOUS   NEXT>

HOME