Scalable Database Server, HiRDB Version 8 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.

Figure 2-23 shows a data search example using a comparison predicate. Here, the product codes and product names of products with 50 or fewer units in stock are searched from the stock table.

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.

Figure 2-24 shows a data search example using a BETWEEN predicate. Here, the product codes and product names of products with between 200 and 300 units in stock are searched from the stock table.

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.

Figure 2-25 shows a data search example using an IN predicate. Here, the product codes and product names of products whose unit price is either 36.40 or 47.60 are searched from the stock table.

Figure 2-25 Data search example using an IN predicate

[Figure]