1.6 Retrieving data with a search range specified (BETWEEN predicate)
The BETWEEN predicate is used to specify a search range. The specification format of the BETWEEN predicate is as follows.
- Specification format
-
SELECT "column-name" FROM "table-name" WHERE "column-name" BETWEEN value-1 AND value-2
- column-name:
-
Specify the column that is being narrowed down by the search range.
- BETWEEN value-1 AND value-2:
-
Specify the lower limit of the search range in value-1. Specify the upper limit of the search range in value-2.
Example: WHERE C1 BETWEEN 10 AND 20
In this example, the search range includes rows where the value of column C1 is between 10 and 20 (including both 10 and 20).
- Note
-
For details about the syntax of the BETWEEN predicate, see 7.19.1 BETWEEN predicate.