Usage Notes - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantage™

The BETWEEN test is satisfied if the following condition is true.

   expression_2 <= expression_1 <= expression_3 

If the BETWEEN test fails, no rows are returned.

The BETWEEN test is treated as two separate logical comparisons.

   expression_1 >= expression_2 AND expression_1 <= expression_3.
This expression … Is equivalent to …
x BETWEEN y AND z ((x >= y) AND (x <=z))

Note that because expression_1 is actually evaluated twice, using a nondeterministic function, such as RANDOM, can produce unexpected results.