top of page
CerebroSQL

SUM

База данных: MySQL

68747470733a2f2f7374796c65732e7265646469746d656469612e636f6d2f74355f32716d366b2f7374796c65

Syntax:
SUM([DISTINCT] expr) [over_clause]

Returns the sum of expr. If the return set has no rows, SUM() returns
NULL. The DISTINCT keyword can be used to sum only the distinct values
of expr.

If there are no matching rows, SUM() returns NULL.

This function executes as a window function if over_clause is present.
over_clause is as described in
https://dev.mysql.com/doc/refman/8.0/en/window-functions-usage.html; it
cannot be used with DISTINCT.

URL: https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html

Example

bottom of page