PL/SQL Between

The BETWEEN condition determines whether the value of one expression is in an interval of two other expressions.

Between example

COURSE_IDNAMEDESCRIPTIONDURATIONPRICE
1SQL 1SQL course for beginners1 week10
2SQL 2SQL course for advanced2 week50
3HTML5Learn HTML 51 week10
4PHPPHP course4 week75
5CSSLearn CSS2 week20
 
SELECT * FROM course WHERE price BETWEEN 20 AND 50;

Output

COURSE_IDNAMEDESCRIPTIONDURATIONPRICE
2SQL 2SQL course for advanced2 week50
5CSSLearn CSS2 week20

Between example

ORDER_IDCOURSE_IDSTUDENT_IDORDER_DATE
11607-AUG-2014 10:11:03
25723-SEP-2014 12:31:41
34529-AUG-2014 09:55:54
215601-DEC-2014 16:32:36
221417-DEC-2014 17:22:27
 
SELECT * FROM orders WHERE order_date BETWEEN '01-AUG-2014' AND '01-OCT-2014';

Output

ORDER_IDCOURSE_IDSTUDENT_IDORDER_DATE
11607-AUG-2014 10:11:03
25723-SEP-2014 12:31:41
34529-AUG-2014 09:55:54
 
SELECT * FROM orders 
WHERE order_date BETWEEN TO_DATE('01-12-2014','DD-MM-YYYY') AND TO_DATE('31-12-2014','DD-MM-YYYY');

Output

ORDER_IDCOURSE_IDSTUDENT_IDORDER_DATE
215601-DEC-2014 16:32:36
221417-DEC-2014 17:22:27