34,333
edits
Changes
no edit summary
<google>BUY_MYSQL</google> Sometimes when working with the data stored in a MySQL database table, we are interested not in the data itself, but in statistics about that data. For example, we may not be concerned about the specific content in each row, whilst we may want to know how many rows are in a table. Alternatively, we may need to find the average of all the values in a particular table column. Information of this type can be obtained using a collection of built-in MySQL ''aggregate functions'' and these functions are the topic of this chapter.
== The MySQL Aggregate Functions ==
</pre>
Feel free to create a similar table, or just follow along with the examples to get an idea of how to use these functionfunctions.
== Using the MySQL AVG() Function ==
== Using the MySQL MAX() Function ==
The MAX() function returns data from the row in which the specified column contains the highest value. For example we can findthe find the most expensive product in our database table:
<pre>
== Using the SUM() Function ==
The SUM() function returns the total of all the values in a a specified column. Therefore, to get the total value of every item in the table:
<pre>
</pre>
<google>BUY_MYSQL_BOTTOM</google>
<hr>