4
The WHERE clause is used to extract only those records that fulfill a specified criterion.
10
WHERE column_name operator value
12
**WHERE Clause Example**
16
+---------+------------+----------+----------+--------+
17
|Id |LastName |FirstName |Address | City |
18
+=========+============+==========+==========+========+
19
| 1 | Larson | Sue |3 Cherry | Chicago|
20
+---------+------------+----------+----------+--------+
21
| 2 | Roberts | Teri |21 Brown | Chicago|
22
+---------+------------+----------+----------+--------+
23
| 3 | Peterson | Kari |30 Mell | Reno |
24
+---------+------------+----------+----------+--------+
26
If you want to select only the persons living in the city "Chicago" from the table above, use the following SELECT statement: ::
31
The result-set will look like this:
33
+---------+------------+----------+----------+--------+
34
| Id |LastName |FirstName |Address |City |
35
+---------+------------+----------+----------+--------+
36
|1 | Larson | Sue |3 Cherry | Chicago|
37
+---------+------------+----------+----------+--------+
38
|2 | Roberts | Teri |21 Brown | Chicago|
39
+---------+------------+----------+----------+--------+
b'\\ No newline at end of file'