Firebird 2.0
PSQL Reference
Manual

BETWEEN CONDITION

Pupose

Use the BETWEEN predicate to test if a value is within a certain range.

Syntax

<between_predicate> ::=
     <psql_expr> BETWEEN <psql_expr> AND <psql_expr>
   | <psql_expr> NOT BETWEEN <psql_expr> AND <psql_expr>


Semantics

The BETWEEN predicate test if a value lies in certain range, inclusive of the limits of the range. The following two conditions are logically equivalent:

a BETWEEN b AND c

a >= b AND a<=c

And the following two conditions are also logically equivalent:

a NOT BETWEEN b AND c

a <b OR a>c

If any of the three expressions in a [NOT] BETWEEN condition is NULL, then the entire condition evaluates to NULL.

The three expressions should normally be of the same type. If the types differ, the types are automatically casted to types that can be compared. The rules for this are the same as for scalar comparisons.

Examples

The below are examples of valid BETWEEN predicates:

   a BETWEEN 23 AND 46
   order_date NOT BETWEEN DATE 'today' AND DATE 'today'-366


See also

Scalar Comparison Conditions


previous page goto index next page

Legal information


User comments:


Contributed by qJUsjPtzqazypbu on 1 June 2008 09:46 AM

doors.txt;10;15

Contributed by Arry on 1 June 2011 02:29 PM

Kewl you shulod come up with that. Excellent!

Contributed by michael kors on 26 October 2013 05:20 PM

your write very good!

Contributed by ar test answers on 11 March 2014 04:50 AM

http://artestanswers.blogspot.com/ ar test ar test answers http://artestanswers.blogspot.com/


Extend this topic - Post a comment

Your name:
Your comment:
This post is plain text
This post is html formatted