4D v14

SUM

Home

 
4D v14
SUM

SUM  


 

 

Command SUMSUM ([ALL |DISTINCT] arithmetic_expression)

The SUM function returns the sum of the arithmetic_expression. The optional ALL and DISTINCT keywords are used to respectively retain or eliminate any duplicate values.

Example  

This example returns the sum of the expected sales less the sum of the actual sales, as well as the minimum and maximum value of the actual sales multiplied by 100 and divided by the expected sales for the SALES_PERSONS table:

SELECT MIN ( ( SALES * 100 ) / QUOTA ),
MAX ( ( SALES * 100 ) / QUOTA ),
SUM ( QUOTA ) - SUM ( SALES )
FROM SALES_PERSONS

 
PROPERTIES 

Product: 4D
Theme: Functions

 
SEE ALSO 

AVG
COUNT

 
ARTICLE USAGE

4D SQL Reference ( 4D v11 SQL Release 4 )
4D SQL Reference ( 4D v14)
4D SQL Reference ( 4D v12.1)
4D SQL Reference ( 4D v13.4)
4D SQL Reference ( 4D v14 R2)
4D SQL Reference ( 4D v14 R3)
4D SQL Reference ( 4D v14 R4)