23 January 2014

SELECT command with SUM () function

SUM () aggregate function returns sum of all column value.

Syntax:

SELECT SUM ([SPECIFIED_COLUMN_NAME]) FROM <TABLE_NAME>

Example:

---- CALCULATE SUM OF ALL VALUE SALARY COLUMN
SELECT SUM(SALARY) AS SUMSALARY FROM STUDENT_MARKS

No comments:

Post a Comment