PL/SQL Sum

Oracle PL/SQL Sum Function

The Sum function returns the summed value of an expression.

The Sum Function syntax:

Select sum( exp ) From table ;

Example 1

Select sum(e.sal) From emp e Where e.job='CLERK' ; 

4150

Example 2

Select e.ename, e.sal, sum(e.sal * 3.5/100) Comm
From emp e
Where e.job='CLERK
Group By e.ename, e.sal;

Result:

EnameSalComm
ADAMS110038.5
JAMES95033.25
SMITH80028
MILLER130045.5