The BETWEEN keyword specifies an inclusive range, in which the lower value and the upper value and the values they bracket are searched for.
Enter the following query:
SELECT Name, UnitPrice FROM Products WHERE UnitPrice BETWEEN 10 AND 15; |
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.
Execute the following query:
SELECT Name, UnitPrice FROM Products WHERE UnitPrice NOT BETWEEN 10 AND 15; |
Name | UnitPrice |
---|---|
Tee Shirt | 9 |
Baseball Cap | 9 |
Visor | 7 |
Visor | 7 |
... | ... |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |