T-SQL Tutorial

T-SQL SUM - Aggregate Function


SUM Example:

CONTRACT_IDAMOUNT
1400
2500
3700

SELECT SUM(c.amount) AS SumAmount
   FROM contracts c
WHERE c.amount > 300;

SumAmount
1600

See also: T-SQL Functions -> Avg -> Count -> Max -> Min