Oracle Tutorial

What is Oracle
SQL Keywords

Oracle Wildcards

Oracle Wildcards

Oracle Aliases

Oracle Aliases

MySQL Tutorial

MySQL Tutorial

PL/SQL Tutorial

PL/SQL Tutorial

Oracle Interview Questions

Oracle Interview Questions and Answers


Oracle avg() Function

The Oracle sum() function returns the average of a numeric field. It is used when you need to find or calculate average of numeric fields value.

Oracle AVG FUNCTION Syntax

To find or calculate average of numeric field in a table, use the following syntax:

Syntax

SELECT AVG(col1) 
FROM tablename
WHERE condition;

Parameters:

tablename: The table name from which you want to fetch records.

col1: The column or field name that will used to calculate average.

condition: To specifies the conditions that must be fulfilled. It is optional.

Oracle AVG FUNCTION example

The following Oracle, calculating average of the numeric field "workingHours" in the "tblCustomerLoan" table:

Example

SELECT AVG(workingHours) AS TotalAverage FROM tblCustomerLoan;

Note:

In the above example, we are calculating average of "workingHours" numeric field value in tblCustomerLoan" table.