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, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.