Oracle Tutorial

What is Oracle
SQL Keywords

Oracle Wildcards

Oracle Wildcards

Oracle Aliases

Oracle Aliases

MySQL Tutorial

MySQL Tutorial

PL/SQL Tutorial

PL/SQL Tutorial

Oracle Interview Questions

Oracle Interview Questions and Answers


Oracle sum() Function

The Oracle sum() function returns the total summed value of a numeric field. It is used when you need to addition the numeric fields value.

Oracle SUM FUNCTION Syntax

To count or calculate number of rows in a table, use the following syntax:

Syntax

SELECT SUM(col1) 
FROM tablename
WHERE condition;

Parameters:

tablename: The table name from which you want to fetch records.

col1: The column or field name that will be summed. It will summed the numeric field values.

Oracle SUM FUNCTION example

The following Oracle, adding the numeric field "workingHours" in the "tblCustomerLoan" table:

Example

SELECT SUM(workingHours) AS TotalHover FROM tblCustomerLoan;