Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle AVG Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: AVG

Definition:
The Oracle AVG function returns the average of a column of numbers. An average is obtained by adding all of the values in a set and then dividing by the number of values in the set.

Example Syntax:

SELECT AVG( value)
FROM table(s)
WHERE predicates;


The value parameter is typically a single column in a table, but can also be an expression or formula which is evaluated. For example, multiple columns in one or more tables could be summed and then averaged.

Example Usage:

SELECT AVG(price) FROM product_table;


In the example above, the AVG() function returns the average cost of all of the values in the price column.

This is an example of using a formula with the AVG() function to compute the average mileage expense:

SELECT AVG(mileage *  0.30) as "Average Mileage Expense"
FROM vehicle_list;


Related Links:

Related Code Snippets:
  • REGR_AVGX - REGR_AVGX evaluates the average of the independent variable (expr2) of the regression ...
  • REGR_AVGY - REGR_AVGY evaluates the average of the independent variable (expr1) of the regression ...
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 278 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?