Nonstop Database, HiRDB Version 9 UAP Development Guide

[Contents][Index][Back][Next]

2.7.1 Searching for data within a specified range of values

To manipulate rows by specifying a range of values, a comparison predicate, a BETWEEN predicate, or an IN predicate is used to set a condition.

Organization of this subsection
(1) Comparison predicate
(2) BETWEEN predicate
(3) IN predicate

(1) Comparison predicate

A comparison predicate is used to specify an equivalence or size comparison as the search condition.

The following figure shows, as an example of a data search using a comparison predicate, the procedure for searching the stock table for the product codes and product names of products with 50 or fewer units in stock.

Figure 2-23 Data search example using a comparison predicate

[Figure]

(2) BETWEEN predicate

A BETWEEN predicate extracts only the data within a specified range of values.

The following figure shows, as an example of a data search using a BETWEEN predicate, the procedure for searching the stock table for the product codes and product names of products with 200 to 300 units in stock.

Figure 2-24 Data search example using a BETWEEN predicate

[Figure]

(3) IN predicate

An IN predicate extracts only those items with data that matches specified multiple values.

The following figure shows, as an example of a data search using an IN predicate, the procedure for searching the stock table for the product codes and product names of products whose unit price is either 36.40 or 47.60.

Figure 2-25 Data search example using an IN predicate

[Figure]