~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/functions/aggregatefunctions.rst

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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
        SELECT "function type" ("column_name")
 
9
        FROM "table_name";
 
10
 
 
11
The following are examples of aggregate functions:
 
12
 
 
13
**AVG**:  Return the average value of the argument. (Does not work with temporal values unless first converted to numeric values.)
 
14
 
 
15
:doc:`count`
 
16
(DISTINCT):  Return the count of a number of different values
 
17
 
 
18
:doc:`count`:  Return a count of the number of rows returned
 
19
        
 
20
**GROUP_CONCAT**:  Return a concatenated string
 
21
 
 
22
**MAX**:  Return the maximum value
 
23
 
 
24
**MIN**:  Return the minimum value
 
25
 
 
26
**STD**:  Return the population standard deviation
 
27
 
 
28
**STDDEV_POP**:  Return the population standard deviation
 
29
 
 
30
**STDDEV_SAMP**:  Return the sample standard deviation
 
31
 
 
32
**STDDEV**:  Return the population standard deviation
 
33
 
 
34
**SUM**:  Return the sum. (Does not work with temporal values unless first converted to numeric values.)
 
35
 
 
36
**VAR_POP**:  Return the population standard variance
 
37
 
 
38
**VAR_SAMP**:  Return the sample variance
 
39
 
 
40
**VARIANCE**:  Return the population standard variance
 
41
 
 
42
.. toctree::
 
43
   :hidden: 
 
44
 
 
45
   count