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:

Ename Sal Comm
ADAMS 1100 38.5
JAMES 950 33.25
SMITH 800 28
MILLER 1300 45.5