BETWEEN Predicate

Selects rows where column values are within a range of values.

Syntax

expression [NOT] BETWEEN expression AND expression

Arguments

expression

specifies any valid SQL expression.

See <sql-expression>
FedSQL Expressions

Details

The BETWEEN predicate specifies a range of column values to select using these criteria:
  • The SQL expressions must be of compatible data types.
  • Because a BETWEEN condition evaluates the boundary values as a range, it is not necessary to specify the smaller quantity first.
  • You can use the NOT logical operator to exclude a range of numbers. For example, you can use NOT to eliminate customer numbers between 1 and 15 (inclusive) so that you can retrieve data on more recently acquired customers.

Example

select * from invtry
   where invtry.name
      between 'A' and 'Mzzz';

See Also

Expressions: