SUM with DISTINCT in Teradata

SUM function can be used with distinct to find out the sum of a field in unique records.

Syntax:
SELECT SUM(distinct expression )
FROM tables
WHERE predicates;


Example:
SELECT SUM(distinct salary) as "Total Salary"
FROM employees
WHERE salary > 25000;