The following illustrates the syntax of an aggregate function:
|
1
|
aggregate_function_name(DISTINCT | ALL expression)
|
In this syntax;
- First, specify the name of an aggregate function that you want to use such as
AVG,SUM, andMAX. - Second, use
DISTINCTif you want only distinct values are considered in the calculation orALLif all values are considered in the calculation. By default,ALLis used if you don’t specify any modifier. - Third, the
expressioncan be a column of a table or an expression that consists of multiple columns with arithmetic operators.
