quick links

MySQL aggregate functions

AVG, COUNT, MIN, MAX, SUM, DISTINCT are aggregate functions

AVG

  • calculates the average of a set of values.
  • SELECT AVG(column_name) FROM table_name WHERE condition;

COUNT

  • counts rows in a specified table or view.
  • SELECT COUNT(column_name) FROM table_name WHERE condition;

MIN

  • gets the minimum value in a set of values.
  • SELECT MIN(column_name) FROM table_name WHERE condition;

MAX

  • gets the maximum value in a set of values.
  • SELECT MAX(column_name) FROM table_name WHERE condition;

SUM

  • calculates the sum of values.
  • SELECT SUM(column_name) FROM table_name WHERE condition;

DISTINCT

  • Distinct keyword is used to find unique values from specified column in a table
  • SELECT distinct(price) prices from SALES
 

About Us

Joomla Web Solution

We love working with PHP, HTML5, CSS3, jQuery and the most-loved content management framework in the world, Joomla!

LIKE US ON FACEBOOK