~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/where.rst

  • Committer: Andrew Hutchings
  • Date: 2011-01-10 16:11:45 UTC
  • mto: (2069.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2070.
  • Revision ID: andrew@linuxjedi.co.uk-20110110161145-isdc0ncbo2hx2n5c
Fix pandora error message

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:
7
 
 
8
 
.. code-block:: mysql
 
6
SQL WHERE Syntax ::
9
7
 
10
8
        SELECT column_name(s)
11
9
        FROM table_name
12
10
        WHERE column_name operator value
13
11
        
14
 
**Simple WHERE Clause Example**
 
12
**WHERE Clause Example**
15
13
 
16
14
The "Persons" table:
17
15
 
25
23
| 3       | Peterson   | Kari     |30 Mell   | Reno   |
26
24
+---------+------------+----------+----------+--------+
27
25
 
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
 
26
If you want to select only the persons living in the city "Chicago" from the table above, use the following SELECT statement: ::
31
27
 
32
28
        SELECT * FROM Persons
33
29
        WHERE City='Chicago'
36
32
 
37
33
+---------+------------+----------+----------+--------+
38
34
| Id      |LastName    |FirstName |Address   |City    |
39
 
+=========+============+==========+==========+========+
 
35
+---------+------------+----------+----------+--------+
40
36
|1        | Larson     | Sue      |3 Cherry  | Chicago|
41
37
+---------+------------+----------+----------+--------+
42
38
|2        | Roberts    | Teri     |21 Brown  | Chicago|
43
 
+---------+------------+----------+----------+--------+
 
39
+---------+------------+----------+----------+--------+
 
 
b'\\ No newline at end of file'