SQL Aggregate Functions

SQL Aggregate functions return a single value, using values in a table column. Below is a list of SQL aggregate functions and how to use them. AVG() Function The AVG() function returns the average value of a numeric column.

view plain print about
1SELECT AVG(column_name) FROM table_name

COUNT() Function This allows us to COUNT up the number of row in a certain table.

view plain print about
1SELECT COUNT(column_name) FROM table_name
COUNT and DISTINCT can be used together in a statement to fetch the number of distinct entries in a table. FIRST() Function The returns the first value of the selected column.
view plain print about
1SELECT FIRST(column_name) FROM table_name
LAST() Function The returns the last value of the selected column.
view plain print about
1SELECT LAST(column_name) FROM table_name
MAX() Function The returns the largest value of the selected column.
view plain print about
1SELECT LAST(column_name) FROM table_name
MIN() Function The returns the smallest value of the selected column.
view plain print about
1SELECT MIN(column_name) FROM table_name
SUM() Function The SUM function is used to calculate the total for a column.
view plain print about
1SELECT SUM(column_name) FROM table_name

TweetBacks
Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.9.5.004. Contact Blog Owner