BETWEEN conditions

The syntax for BETWEEN conditions is as follows:

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

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

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

expr >= start-expr AND expr <= end-expr

Subqueries cannot be used inside a BETWEEN predicate.

Compatibility

The BETWEEN condition is compatible between Sybase IQ and Adaptive Server Enterprise.