VistaDB 6
VistaDB / Developer's Guide / SQL Reference / Functions / Aggregate Functions / AVG
In This Topic
    AVG
    In This Topic

    The AVG function returns the average value of a column in a selection. NULL values are not included in the calculation. The column must be a numerical column.

    AVG(colName) evaluates colName for each row in a table and returns the average.

    AVG(ALL colName) evaluates colName for each non null row in a table. ALL is the default syntax.

    AVG(DISTINCT colName) evaluates colName for each distinct row in a table and returns the average (duplicate values are ignored)

    During join queries a colName must be fully qualified using the table name as well.

    Example:

    AVG(table.colName)



    Example

    SELECT AVG(column) FROM table;
    
    See Also