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/

Contributed by http://southwesternservices.com/back.html on 20 November 2014 01:31 AM

http://blog.daytonahilton.com/my-blog/2013/05/hit-the-beach-with-daytonas-oceanside-watersports-rentals-lessons-more.html [url=http://southwesternservices.com/back.html]http://southwesternservices.com/back.html[/url]

Contributed by Nayeli on 21 December 2015 10:49 AM

It\'s a joy to find sonemoe who can think like that

Contributed by c serum on 5 January 2016 11:38 PM

Go here for the best anti wrinkle serum currently in stock on the market plus at the best price.

Contributed by topical vitamin c on 7 January 2016 03:15 PM

See here for the best anti wrinkle currently available around and reasonably priced.

Contributed by Not another bot on 28 January 2016 09:23 AM

SELECT 
    CASE WHEN \'2016-01-25 00:00:00.000\' BETWEEN \'2016-01-22\' AND \'2016-01-25\' THEN 1 ELSE 0 END AS TSCASE,
    CASE WHEN \'2016-01-25\' BETWEEN \'2016-01-22\' AND \'2016-01-25\' THEN 1 ELSE 0 END AS DATECASE
FROM RDB$DATABASE

TSCASE	DATECASE
0	1


Extend this topic - Post a comment

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