Oracle: Between Condition

BETWEEN in Oracle is used to return values under a specified range. The range is set in oracle using AND. You can perform BETWEEN operations with the Select, Delete or Update clause. To apply BETWEEN Operation follows the syntax as below:

Syntax

Select Column from Table 
where column BETWEEN Range_1 AND Range_2;

Example

For instance, we have a table Stu as shown below:

Stu Table

Now, we need to find the values that have roll numbers between 1 to 20. for that either we can use <= or >= comparison operator or to be more concise we can use BETWEEN Operation. Follow the below code to apply the same:

select * from stu 
where Roll_no BETWEEN 1 AND 20;

Output

between

NOTE: We can also follow the same Operation with Delete or Update as:

between

between