--- /usr/local/postgresql-7.0.2/doc/src/sgml/func.sgml Mon May 15 02:41:18 2000 +++ func.sgml Fri Jun 16 00:46:29 2000 @@ -1515,6 +1515,87 @@ + + + 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. + + + +
+
+
+