Postgresql Average Example - Sql

How to find average value of an expression in SQL query?

Snippet Code


  
Rate this page :
  [ 0 votes]

Postgresql is an AVG function which gets the average of all selected values of records. Simple code to find the average value of an expression is given below

Syntax: -------- SELECT avg(aggregate_expression) FROM tables WHERE conditions; Example: ---------- SELECT status_type, AVG(vote) FROM rating;

Tags


Ask Questions

Ask Question