Use the BETWEEN condition to display rows based on a range of values.
SELECT last_name, salary
FROM employees
WHERE salary BETWEEN 2500 AND 3500;
The BETWEEN Condition
You can display rows based on a range of values using the BETWEEN range condition. The range that you
specify contains a lower limit and an upper limit.
The SELECT statement on the slide returns rows from the EMPLOYEES table for any employee whose
salary is between $2,500 and $3,500.
Values specified with the BETWEEN condition are inclusive. You must specify the lower limit first .
No comments:
Post a Comment