[Figure: Example of specifying IN predicate]
The values to be compared in the value expression are enclosed in parentheses and specified in a quantified value list.
Use host variables or literals to specify values in a quantified value list. Column names cannot be specified.
The result of the IN predicate is true if the value for the value expression is equal to one of the values enclosed in
parentheses. The result is false if the value for the value expression does not equal one of the values enclosed in
parentheses. The result is undefined if the value of the value expression is a null value or if all the values enclosed in
parentheses are null values.
Using a subquery in the IN predicate
If the values to be compared to the value expression are values derived from another table, enter a subquery instead
of a quantified value list.
The format of the subquery specification in parentheses is the same as that for a query specification. However, the
table derived from the subquery must have only one column. This means that one value expression (such as a column
name or a function) can be specified in the left-hand side of the search condition. The following is an example of the
IN predicate in which a subquery is used:
Example 2:
In this example, the names of companies that have ordered the product that has ITMNO (PRODNO)
"351" are fetched.
96