SQL select aggregate functions examples

In this post we will cover most used SQL select aggregate functions and somoe special key words:

MIN(), MAX(), COUNT(), AVG() and SUM()

TOP, LIMIT or ROWNUM

SQL LIKE

SQL IN

SQL select MIN(), MAX(), COUNT(), AVG() and SUM()

Several very useful functions in SQL ( and MySQL ) could be used in order to get the maximum or mimimun value per column. The same can be done for average. If you don't provide where clause then the functions are applied over the whole table

SELECT
MAX(list_price) AS Maximum,
MIN(list_price) AS Minimal,
AVG(list_price) AS Average
FROM products;
SELECT
SUM(quantity) AS sum
FROM purchase_order_details;