Oracle® TimesTen InMemory Database SQL Reference Release 11.2.1 Part Number E1307003 


View PDF 
The ALL/NOT IN quantified predicate compares an expression or list of expressions with a list of specified values. The ALL predicate evaluates to TRUE if all the values in the ValueList
relate to the expression or list of expressions as indicated by the comparison operator. Similarly, the NOT IN predicate evaluates to TRUE if the expression or list of expressions does not equal one of the values in the list.
RowValueConstructor {CompOp ALL  NOT IN} ValueList
The syntax for RowValueConstructor
:
RowValueConstructorElement  (RowValueConstuctorList) 
The syntax for RowValueConstructorList
:
RowValueConstructorElement[{, RowValueConstructorElement} ... ]
The syntax for RowValueConstructorElement
:
Expression  NULL
The syntax for CompOp
:
{=  <>  >  >=  <  <= }
The syntax for more than one element in the ValueList
:
({Constant  ?  :DynamicParameter} [,...] )
The syntax for one element in the ValueList
not enclosed in parentheses:
Constant  ?  :DynamicParameter
The syntax for an empty ValueList
:
( )
The syntax for the ValueList
for a list of expressions:
(({Constant  ?  :DynamicParameter} [,...]))
Parameters
Component  Description 

Expression 
Specifies a value to be obtained. The values in ValueList must be compatible with the expression. For information on the syntax of expressions, see "Expression specification". 
=  Is equal to. 
<>  Is not equal to. 
>  Is greater than. 
>=  Is greater than or equal to. 
<  Is less than. 
<=  Is less than or equal to. 
ALL  The predicate is TRUE if all the values in the ValueList relate to the expression or list of expressions as indicated by the comparison operator. 
ValueList 
A list of values that are compared against the expression's or list of expression's value. The ValueList cannot contain a column reference or a subquery. The ValueList can be nested if the left operand of the ValueList is a list.
Elements of the

Description
If X
is the value of Expression
, and (a,b, ..., z)
represents the elements in ValueList
, and OP
is a comparison operator, then the following is true:
X OP ALL (a,b,...,z)
is equivalent to X OP a AND X OP b AND...AND X OP z
.
If X
is the value of Expression
and (a,b,..., z)
are the elements in a ValueList
, then the following is true:
X NOT IN (a,b,...,z)
is equivalent to NOT (X IN (a,b,...,z))
.
Character strings are compared according to the ASCII collating sequence for ASCII data.
NULL cannot be specified in ValueList
.
See "Numeric data types" for information about how TimesTen compares values of different but compatible types.
NOT IN or NOT EXISTS with ALL can be specified in an OR expression.
IN and EXISTS with ALL can be specified in an OR expression.
When evaluating an empty ValueList
, the result of Expression
NOT IN is true.
If RowValueConstructorList
is specified only the operators = and <> are allowed.
Examples
To query an empty select list for a NOT IN condition:
SELECT * FROM t1 WHERE x1 NOT IN ();