Jump to content

sql aggregate values and aggregate functions


hisoka

Recommended Posts

in this two links :

 

in the first link :

 

 

http://en.wikipedia.org/wiki/Having_%28SQL%29

 

 

A HAVING clause in SQL specifies that an SQL SELECT statement should only return rows where aggregate values meet the specified conditions. It was added to the SQL language because the WHERE keyword could not be used with aggregate functions.[1]

 

 

what is an aggregate value??

 

in the second link:

 

http://en.wikipedia.org/wiki/Aggregate_function

 

 

In database management an aggregate function is a function where the values of multiple rows are grouped together as input on certain criteria to form a single value of more significant meaning or measurement such as a set, a bag or a list.

 

I do not understand what is an aggregate function even after reading in the wikipedia

 

I would like to know what they mean in depth

Link to comment
Share on other sites

Perhaps you would understand an aggregate function if you saw one in action. An aggregate function operates on a whole lot of rows but only returns one value.

 

For example, AVG() returns the average of a value from all the selected rows, MAX() returns the highest value of all the selected rows and SUM() adds up all the rows and returns the result

 

Aggregate function are often used with the GROUP BY and HAVING clauses

Link to comment
Share on other sites

There's nothing saying aggregate value, it's an aggregate function because it aggregates the results.

 

See the dictionary for what aggregate means: http://dictionary.reference.com/browse/aggregate

 

Adjective:

 

formed by the conjunction or collection of particulars into a whole mass or sum

 

And verb:

 

to bring together; collect into one sum, mass, or body

  • Like 1
Link to comment
Share on other sites

so an aggregate function is called aggregate as it "operates on a whole lot of rows" or many rows combined together . If I am wrong please correct me

 

 

"There's nothing saying aggregate value"

 

this sentence says aggregate value

 

A HAVING clause in SQL specifies that an SQL SELECT statement should only return rows where aggregate values meet the specified conditions

Link to comment
Share on other sites

Oh, in that context, an aggregate value is a value returned by the aggregate function, for example, an aggregate value could be the sum of all the rows.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...