~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/where.rst

  • Committer: Brian Aker
  • Date: 2011-03-24 23:14:46 UTC
  • mfrom: (2246.4.12 foreach)
  • Revision ID: brian@tangent.org-20110324231446-7q1gydkglys73nft
Merge in XTF

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
The WHERE clause is used to extract only those records that fulfill a specified criterion.
5
5
 
6
 
Simple SQL WHERE Syntax ::
 
6
Simple SQL WHERE Syntax:
 
7
 
 
8
.. code-block:: mysql
7
9
 
8
10
        SELECT column_name(s)
9
11
        FROM table_name
23
25
| 3       | Peterson   | Kari     |30 Mell   | Reno   |
24
26
+---------+------------+----------+----------+--------+
25
27
 
26
 
If you want to select only the persons living in the city "Chicago" from the table above, use the following SELECT statement: ::
 
28
If you want to select only the persons living in the city "Chicago" from the table above, use the following SELECT statement:
 
29
 
 
30
.. code-block:: mysql
27
31
 
28
32
        SELECT * FROM Persons
29
33
        WHERE City='Chicago'
32
36
 
33
37
+---------+------------+----------+----------+--------+
34
38
| Id      |LastName    |FirstName |Address   |City    |
35
 
+---------+------------+----------+----------+--------+
 
39
+=========+============+==========+==========+========+
36
40
|1        | Larson     | Sue      |3 Cherry  | Chicago|
37
41
+---------+------------+----------+----------+--------+
38
42
|2        | Roberts    | Teri     |21 Brown  | Chicago|