MIN
Examples
SELECT
dept_no,
MIN(salary)
FROM employee
GROUP BY dept_no
MIN
ExamplesSELECT
dept_no,
MIN(salary)
FROM employee
GROUP BY dept_no
SUM()
Sum
Depends on the input type
SUM ([ALL | DISTINCT] <expr>)
Parameter | Description |
---|---|
expr |
Numeric expression.It may contain a table column, a constant, a variable, an expression, a non-aggregate function or a UDF.Aggregate functions are not allowed as expressions. |
SUM
calculates and returns the sum of non-NULL
values in the group.
If the group is empty or contains only NULL
s, the result is NULL
.
ALL
is the default option — all values in the set that are not NULL
are processed.If DISTINCT
is specified, duplicates are removed from the set and the SUM
evaluation is done afterwards.
The result type of SUM
depends on the input type:
|
|
|
|
|
|
|
|
|
|
|
|