~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/functions/aggregatefunctions.rst

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Aggregate Functions
 
2
===================
 
3
 
 
4
SQL group (aggregate) functions operate on sets of values. If you use an aggregate function in a statement containing no GROUP BY clause, it is equivalent to grouping on all rows.
 
5
 
 
6
General syntax for aggregate functions is:
 
7
 
 
8
.. code-block:: mysql
 
9
 
 
10
        SELECT "function type" ("column_name")
 
11
        FROM "table_name";
 
12
 
 
13
The following are examples of aggregate functions:
 
14
 
 
15
**AVG**:  Return the average value of the argument. (Does not work with temporal values unless first converted to numeric values.)
 
16
 
 
17
:doc:`count`
 
18
(DISTINCT):  Return the count of a number of different values
 
19
 
 
20
:doc:`count`:  Return a count of the number of rows returned
 
21
        
 
22
**GROUP_CONCAT**:  Return a concatenated string
 
23
 
 
24
**MAX**:  Return the maximum value
 
25
 
 
26
**MIN**:  Return the minimum value
 
27
 
 
28
**STD**:  Return the population standard deviation
 
29
 
 
30
**STDDEV_POP**:  Return the population standard deviation
 
31
 
 
32
**STDDEV_SAMP**:  Return the sample standard deviation
 
33
 
 
34
**STDDEV**:  Return the population standard deviation
 
35
 
 
36
**SUM**:  Return the sum. (Does not work with temporal values unless first converted to numeric values.)
 
37
 
 
38
**VAR_POP**:  Return the population standard variance
 
39
 
 
40
**VAR_SAMP**:  Return the sample variance
 
41
 
 
42
**VARIANCE**:  Return the population standard variance
 
43
 
 
44
.. toctree::
 
45
   :hidden: 
 
46
 
 
47
   count