📅  最后修改于: 2020-12-02 02:01:00             🧑  作者: Mango
SUM()函数用于返回SELECT语句中表达式的总和。
句法:
SELECT SUM(aggregate_expression)
FROM tables
[WHERE conditions];
例:
首先创建一个表“ Employees”:
在该表中插入一些数据:
SELECT SUM(salary) AS "Total Salary"
FROM [javatpoint].[dbo].[Employees]
WHERE salary > 20000;
输出: