Neoview SQL Reference Manual (R2.4)

Predicates
A predicate determines an answer to a question about a value or group of values. A predicate
returns true, false, or, if the question cannot be answered, unknown. Use predicates within search
conditions to choose rows from tables or views.
Determines whether a sequence of values is within a range
of sequences of values.
“BETWEEN Predicate” (page 267)
Compares the values of sequences of expressions, or
compares the values of sequences of row values that are
the result of row subqueries.
“Comparison Predicates” (page 268) ( =, <>, <, >, <=, >= )
Determines whether any rows are selected by a subquery.
If the subquery finds at least one row that satisfies its
search condition, the predicate evaluates to true.
Otherwise, if the result table of the subquery is empty, the
predicate is false.
“EXISTS Predicate” (page 272)
Determines if a sequence of values is equal to any of the
sequences of values in a list of sequences.
“IN Predicate” (page 273)
Searches for character strings that match a pattern.“LIKE Predicate” (page 275)
Determines whether all the values in a sequence of values
are null.
“NULL Predicate” (page 277)
Compares the values of sequences of expressions to the
values in each row selected by a table subquery. The
comparison is quantified by ALL, SOME, or ANY.
“Quantified Comparison Predicates” (page 278) ( ALL,
ANY, SOME )
See the individual entry for a predicate or predicate group.
BETWEEN Predicate
“Considerations for BETWEEN”
“Examples of BETWEEN”
The BETWEEN predicate determines whether a sequence of values is within a range of sequences
of values.
row-value-constructor [NOT] BETWEEN
row-value-constructor AND row-value-constructor
row-value-constructor is:
(expression [,expression ]...)
| row-subquery
row-value-constructor
specifies an operand of the BETWEEN predicate. The three operands can be either of:
(expression [,expression ]...)
is a sequence of SQL value expressions, separated by commas and enclosed in parentheses.
expression cannot include an aggregate function unless expression is in a HAVING
clause. expression can be a scalar subquery (a subquery that returns a single row
consisting of a single column). See “Expressions” (page 240).
row-subquery
is a subquery that returns a single row (consisting of a sequence of values). See “Subquery”
(page 288).
The three row-value-constructors specified in a BETWEEN predicate must contain the
same number of elements. That is, the number of value expressions in each list, or the number
of values returned by a row subquery, must be the same.
The data types of the respective values of the three row-value-constructors must be
comparable. Respective values are values with the same ordinal position in the two lists. See
“Comparable and Compatible Data Types” (page 231).
Predicates 267