SAND CDBMS SQL Reference Guide
Selection Criteria for WHERE and HAVING Clauses

 

Predicates


BETWEEN Predicate

The BETWEEN operator allows SAND CDBMS to evaluate whether or not data values fall within the range of values indicated in the predicate.

The format for a predicate with a BETWEEN operator is shown below.


Each occurrence of the expression x is evaluated to determine if it sorts between and including the range values indicated by y and z (the range values in the BETWEEN clause are also part of the result set). The three variables above can consist of any combination of value expressions, although x is typically a column name.

ASYMMETRIC and SYMMETRIC are options that relate to the order of specification of the value expressions appearing after the BETWEEN keyword. ASYMMETRIC dictates that the first value expression (y) must return a range value less than the second (z). If SYMMETRIC is specified, y may be greater than the z.

ASYMMETRIC is the default if neither keyword is specified.

Example

The following query selects all Part table records with weight column values between 15 and 18:

SELECT pno, pname
  FROM part
    WHERE weight BETWEEN 15 AND 18;

The following records are retrieved:

pno pname
P2 BOLT

 

Other Predicates: