BETWEEN/NOT BETWEEN Usage Notes - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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.
Expression Equivalent Expression
x BETWEEN y AND z ((x >= y) AND (x <=z))

Because expression_1 is evaluated twice, using a nondeterministic function, such as RANDOM, can produce unexpected results.