~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/distinct.rst

edit

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
Sometimes it's helpful to list only the different, distinct values in a table; in this case the DISTINCT keyword can be used.
7
7
 
8
 
SQL SELECT DISTINCT Syntax: 
9
 
 
10
 
.. code-block:: mysql
 
8
SQL SELECT DISTINCT Syntax: ::
11
9
 
12
10
        SELECT DISTINCT column_name(s)
13
11
        FROM table_name
26
24
| 3       | Peterson   | Kari     |30 Mell   | Reno   |
27
25
+---------+------------+----------+----------+--------+
28
26
 
29
 
In order to select distinct values from the column named "City" from the table above, use the following SELECT statement:
30
 
 
31
 
.. code-block:: mysql
 
27
In order to select distinct values from the column named "City" from the table above, use the following SELECT statement: ::
32
28
 
33
29
        SELECT DISTINCT City FROM Persons;
34
30