The BETWEEN
operator is used in situations where you are searching records between, and
inclusive of, a range. You provide a lower value just after the BETWEEN
keyword, and put the higher value after the AND logical operator as
demonstrated in the following example, where you are trying to fetch employees
records whose join date is between 01-JAN-06 and 31-JAN-06, inclusive. Note
that date values are also enclosed in single quotation marks and are defined in
the default format as ‘DD-MON-YY’.
SQL Statement :
SELECT first_name, last_name, hire_date
FROM employees
WHERE hire_date BETWEEN '01-JAN-06' AND
'31-JAN-06';
Output :
No comments:
Post a Comment