Fujitsu J2X0-1634-01EN Computer Accessories User Manual


 
A comparison predicate can also be used to check whether a value is in a certain range. In the following example, the
specified comparison predicate has the same effect as the BETWEEN predicate in Example 1:
Example 4:
In this example, rows for which STOCKQTY is greater than or equal to 50 but less than or equal to 100
are fetched from the STOCK table.
6.2.3 Checking whether values are contained in a set of values
Checking whether values are contained in a set of values
Use the IN predicate to check whether certain values are contained in a set of quantified values. Use a quantified
value list or a subquery to specify the set of values to be compared. The following is an example of specifying a
quantified value list:
Example 1:
In this example, any row in the STOCK table for which ITMNO is 123, 124, 226, or 227 is specified.
Figure: Example of specifying IN predicate shows the result of specifying this quantified value list.
95