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

SQL Anywhere 10.0.1 » UltraLite - Database Management and Reference » UltraLite SQL Elements Reference » Expressions in UltraLite » Search conditions in UltraLite

ANY conditions Next Page

BETWEEN conditions


Specifies an inclusive range, in which the lower value and the upper value are searched for as well as the values they delimit.

Syntax

expression [ NOT ] BETWEEN start-expression AND end-expression

Remarks

The BETWEEN condition can evaluate to TRUE, FALSE, or UNKNOWN. Without the NOT keyword, the condition evaluates as TRUE if expression is between start-expression and end-expression. The NOT keyword reverses the meaning of the condition, but leaves UNKNOWN unchanged.

The BETWEEN condition is equivalent to a combination of two inequalities:

[ NOT ] ( expression >= start-expression
AND expression <= end-expression )

Example

List all the products cheaper than $10 or more expensive than $15.

SELECT Name, UnitPrice
FROM Products
WHERE UnitPrice NOT BETWEEN 10 AND 15