January 16th, 2009

MAX (Maximum)

Posted by admin in J. Column Functions

The MAX function returns the maximum value of a collection of values.
The expression is a column name, numeric expression, or literal.
Null values are removed.
The argument values can be character, numeric, or datetime.
The result can be character, numeric, datetime, or NULL, if there are no values.
The minimum of no rows is NULL, not zero.
The keyword, DISTINCT, can be used, but it serves no purpose and it doesn’t change the results.
The result is only as precise as the data types used in the expression.
The maximum with character data means the highest sort order. See ORDER BY.

 

                    MAX(expression)

                              or

                    MAX(DISTINCT column-name) <– No difference in the result.

 

To SELECT other columns associated with the MAX row, see the HAVING clause.

January 15th, 2009

MIN (Minimum)

Posted by admin in J. Column Functions

The MIN function returns the minimum value of a collection of values.
The expression is a column name, numeric expression, or literal.
Null values are removed.
The argument values can be character, numeric, or datetime.
The result can be character, numeric, datetime, or NULL, if there are no values.
The minimum of no rows is NULL, not zero.
The keyword DISTINCT can be used, but it serves no purpose and it doesn’t change the results.
The result is only as precise as the data types used in the expression.
The minimum with character data means the lowest sort order. See ORDER BY.

                                     MIN(expression)

                                               or

                              MIN(DISTINCT column-name) <– No difference in the result.

 To SELECT other columns associated with the MIN row, see the HAVING clause.

January 14th, 2009

AVG (Average)

Posted by admin in J. Column Functions

The AVG function returns the average, or arithmetic mean, of a collection of numbers.
The arithmetic mean is the sum of the values divided by the number of quantities.
The expression is a column name, numeric expression, or literal that only involves numeric values or nulls. Null values are removed.
The average of no rows is NULL, not zero.
DISTINCT will remove duplicate values.
The result is only as precise as the data types used in the expression.

                                                   AVG(expression)

                                                             or

                                         AVG(DISTINCT column-name)

« Previous PageNext Page »