Subscripting in a WHERE clause
You can use subscripting in the WHERE clause
of a SELECT statement to specify a range of characters or numbers
in a column, as the following query shows.
Figure 1. Query
SELECT catalog_num, stock_num, manu_code, cat_advert,
cat_descr
FROM catalog
WHERE cat_advert[1,4] = 'High';
The subscript [1,4] causes
the query to retrieve all rows in which the first four letters of
the cat_advert column are High, as result
shows.
Figure 2. Query
result
catalog_num 10004
stock_num 2
manu_code HRO
cat_advert Highest Quality Ball Available, from Hand-Sti
tching to the Robinson Signature
cat_descr
Jackie Robinson signature ball. Highest professional quality,
used by National League.
catalog_num 10005
stock_num 3
manu_code HSK
cat_advert High-Technology Design Expands the Sweet Spot
cat_descr
Pro-style wood. Available in sizes: 31, 32, 33, 34, 35.
⋮
catalog_num 10045
stock_num 204
manu_code KAR
cat_advert High-Quality Beginning Set of Irons. Appropriate
for High School Competitions
cat_descr
Ideally balanced for optimum control. Nylon covered shaft.
catalog_num 10068
stock_num 310
manu_code ANZ
cat_advert High-Quality Kickboard
cat_descr
White. Standard size.