BETWEEN Condition
The BETWEEN condition is satisfied when the value to the left of
BETWEEN is in the inclusive range of the two values on the right of
BETWEEN. The first two queries in the following example use literal
values after the BETWEEN keyword. The third query uses the built-in
CURRENT function and a literal interval to search for dates between
the current day and seven days earlier.
SELECT stock_num, manu_code FROM stock WHERE unit_price BETWEEN 125.00 AND 200.00; SELECT DISTINCT customer_num, stock_num, manu_code FROM orders, items WHERE order_date BETWEEN '6/1/07' AND '9/1/07'; SELECT * FROM cust_calls WHERE call_dtime BETWEEN (CURRENT - INTERVAL(7) DAY TO DAY) AND CURRENT;
For more information, see the BETWEEN Condition.