Range rule

A range rule uses SQL relational and logical operators to define the boundaries of each fragment in a table. A range rule can contain the following restricted set of operators:
  • The relational operators >, <, >=, <=
  • The logical operators AND and OR
  • Algebraic expressions including built-in functions
A range rule can be based on a simple algebraic expression as shown in the following example. In this example, the expression is a simple reference to a column.
FRAGMENT BY EXPRESSION
id_num > 0  AND id_num <= 20 IN dbsp1,
id_num > 20 AND id_num <= 40 IN dbsp2,
id_num > 40 IN dbsp3

The expression in a range rule can be a conjunction or disjunction of more algebraic expressions. The next example shows two algebraic expressions used to define two sets of ranges. The first set of ranges is based on the algebraic expression: "YEAR(Died) - YEAR(Born)"; the second set of ranges is based on "MONTH(Born)."

FRAGMENT  BY  EXPRESSION
YEAR(Died) - YEAR(Born) < 21 AND MONTH(Born) >= 1  AND MONTH(Born) < 4 IN dbsp1,
YEAR(Died) - YEAR(Born) < 40 AND MONTH(Born) >= 4  AND MONTH(Born) <  7 IN dbsp2,