Computes the average, for a set of rows, of a numeric expression or of a set of unique values.
AVG( numeric-expression | DISTINCT numeric-expression )
numeric-expression The expression whose average is calculated over a set of rows.
DISTINCT clause Computes the average of the unique numeric values in the input.
Returns the NULL value for a group containing no rows.
Returns DOUBLE if the argument is DOUBLE, otherwise NUMERIC.
This average does not include rows where the numeric-expression is the NULL value.
SQL/2003 Core feature.
The following statement returns the value 49988.623200.
SELECT AVG( Salary ) FROM Employees; |
The following statement returns the average product price from the Products table:
SELECT AVG( DISTINCT UnitPrice ) FROM Products; |
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |