BETWEEN
The BETWEEN operators provides an option of expressing conditions within
some upper and lower bound. The
Example:
Suppose we are interested in information for the orders table about all
columns whose freight order value is between 10 and 20 loads. The filter
for this result, we write the following query using the
select *
from orders
where freight between 10 and 20
| order_id | customer_id | ship_country | ship_via | freight | order_date |
| -------- | ----------- | ------------ | -------- | ------- | ---------- |
| 3002 | 2002 | Germany | 2 | 18.75 | 2023-01-20 |
| 3006 | 2006 | UK | 1 | 15.6 | 2023-02-10 |
| 3008 | 2008 | France | 2 | 19.45 | 2023-02-20 |
| 3011 | 2011 | Germany | 1 | 12.3 | 2023-03-05 |
| 3014 | 2014 | Canada | 1 | 16.75 | 2023-03-20 |
Notice that the resulting output contains records whose total invoice
value that is between the parameters we set in the query, 10 to 20
freight load. Like I mentioned earlier, the
This concludes our discussion of the