ISum Class
Exposes API's to return sum of all non-NULL values in the group. If there are no non-NULL input rows then sum() returns NULL but total() returns 0.0. NULL is not normally a helpful result for the sum of no rows but the SQL standard requires it and most other SQL database engines implement sum() that way so SQLite does it in the same way in order to be compatible. The result of sum() is an integer value if all non-NULL inputs are integers.
Item Index
Methods
and
-
column
Used to specify AND condition between where clause.
Parameters:
-
column
ColumnName of column on which condition need to be specified.
Returns:
ISumClause Interface.
column
-
column
Used to provide name of column for which sum will be calculated.
Parameters:
-
column
StringName of column.
Returns:
ISum Interface.
execute
()
Object
Used to get sum, this method should be called in last to calculate sum.
Returns:
Return sum.
executeAsync
-
callback
Used to get sum asynchronous, this method should be called in last to calculate sum.
Parameters:
-
callback
CallbackRequest Callback.
groupBy
-
columns
Used to specify GROUP BY statement in conjunction with the aggregate functions to group the result-set by one or more columns.
Parameters:
-
columns
ArrayName of columns.
Returns:
ISum Interface.
having
-
column
Used to specify HAVING clause to SQL because the WHERE keyword could not be used with aggregate functions.
Parameters:
-
column
StringName of column on which condition need to be applied.
Returns:
ISumClause Interface.
havingClause
-
havingClause
Used to provide manually created Where clause, instead of using API's.
Parameters:
-
havingClause
StringWhere clause.
Returns:
ISum Interface.
or
-
column
Used to specify OR condition between where clause.
Parameters:
-
column
ColumnName of column on which condition need to be specified.
Returns:
ISumClause Interface.
where
-
column
Column name of which condition will be specified.
Parameters:
-
column
StringName of column.
Returns:
ISumClause Interface.