diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 3b50375e160..0023a28b0aa 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1515,6 +1515,87 @@ Not defined by this name. Implements the intersection operator '#' + + + Aggregate Functions + + + Author + + Written by Isaac Wilcox + on 2000-06-16. + + + + + Aggregate functions allow the generation of simple + statistics about the values of particular columns over the selected set + of rows. See also and + . + + + + + Aggregate Functions + + + + Function + Returns + Description + Example + Notes + + + + + COUNT(*) + int4 + Counts the selected rows. + COUNT(*) + + + + COUNT(column-name) + int4 + Counts the selected rows for which the value of column-name is not NULL. + COUNT(age) + + + + SUM(column-name) + Same as the data type of the column being summed. + Finds the total obtained by adding the values of column-name across all selected rows. + SUM(hours) + Summation is supported on the following data types: int8, int4, int2, float4, float8, money, interval, numeric + + + MAX(column-name) + Same as the data type of the column whose maximum value is sought. + The maximum value of column-name across all selected rows. + MAX(age) + Finding the maximum value is supported on the following data types: int8, int4, int2, float4, float8, date, time, timetz, money, timestamp, interval, text, numeric. + + + MIN(column-name) + same as the data type of the column whose minimum value is sought. + The minimum value of column-name across all selected rows. + MIN(age) + Finding the minimum value is supported on the following data types: int8, int4, int2, float4, float8, date, time, timetz, money, timestamp, interval, text, numeric. + + + AVG(column-name) + Same as the data type of the column being averaged. + The average (mean) of the values in the given column across all selected rows. + AVG(age) + Finding the mean value is supported on the following data types: int8, int4, int2, float4, float8, money, interval, numeric. Note that as the return type is the same as that of the data being averaged, using AVG() on discrete data will give a rounded result. + + + +
+
+
+ @@ -1032,7 +1032,7 @@ SELECT S.SNAME, P.PNAME - Aggregate Operators + Aggregate Operators SQL provides aggregate operators diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml index f07da189173..6c9ccaf45e5 100644 --- a/doc/src/sgml/syntax.sgml +++ b/doc/src/sgml/syntax.sgml @@ -1,5 +1,5 @@ @@ -747,7 +747,7 @@ sqrt(emp.salary) - Aggregate Expressions + Aggregate Expressions An aggregate expression represents the application