SQL Aggregate function avg()

In this chapter you will learn:
About function Avg ()
Syntax of function Avg ()
Example of function Avg ()

About function avg()

SQL function Avg () is an aggregate function which is used to retrieve the value of columns after calculating its average. It returns average of numeric expression, either all or distinct. This functions helps when user want to know the average of the specific column of the table.

Syntax of function Avg ()

SELECT Avg(column_name) from table_name

Example of function Avg ()

select 'Average Rate'=avg(rate) from humanresources.employeepayhistory
function avg() example screen shot
SUMMARY

In this chapter, you have learned about function Avg () with an example. We think that now you can use this function easily so now in the next chapter you will learn about function count ().

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.