WHERE clause to specify a range of initial characters
The following query selects only those rows where the manu_code begins
with A through H and returns the
rows that the result shows. The test '[A-H]' specifies
any single letter from A through H,
inclusive. No equivalent wildcard symbol exists for the LIKE keyword.
Figure 1. Query
SELECT stock_num, manu_code, description, unit_price
FROM stock
WHERE manu_code MATCHES '[A-H]*'
ORDER BY description, manu_code;
Figure 2. Query
result
stock_num manu_code description unit_price
205 ANZ 3 golf balls $312.00
205 HRO 3 golf balls $312.00
2 HRO baseball $126.00
3 HSK baseball bat $240.00
1 HRO baseball gloves $250.00
1 HSK baseball gloves $800.00
7 HRO basketball $600.00
⋮
313 ANZ swim cap $60.00
6 ANZ tennis ball $48.00
5 ANZ tennis racquet $19.80
8 ANZ volleyball $840.00
9 ANZ volleyball net $20.00
304 ANZ watch $170.00