1.4.9.1. Specifying Retrieval Criteria

To restrict the set of rows retrieved by the SELECT statement, use a WHERE clause that specifies the criteria that column values must satisfy. For example, you can search for a range of numeric values:

mysql> SELECT * FROM score WHERE score > 95; +------------+----------+-------+ | student_id | event_id | score | +------------+----------+-------+ |          5 |        3 |    97 | |         18 |        3 |    96 | |          1 |        6 |   100 | |          5 |        6 |    97 | |         11 |        6 |    98 | |         16 |        6 |    98 | +------------+----------+-------+

You can look for string values containing character data. For the default character set and collation ...

Get MySQL, Fifth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.