Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - SQL Usage » Querying and Modifying Data » Querying data » The WHERE clause: Specifying rows

 

Using ranges in the WHERE clause

The BETWEEN keyword specifies an inclusive range, in which the lower value and the upper value and the values they bracket are searched for.

♦  To list all the products with prices between $10 and $15, inclusive
Name UnitPrice
Tee Shirt 14
Tee Shirt 14
Baseball Cap 10
Shorts 15

You can use NOT BETWEEN to find all the rows that are not inside the range.

♦  To list all the products cheaper than $10 or more expensive than $15
Name UnitPrice
Tee Shirt 9
Baseball Cap 9
Visor 7
Visor 7
... ...