Show:

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.

Methods

and

(
  • column
)
ISumClause

Used to specify AND condition between where clause.

Parameters:

  • column Column

    Name of column on which condition need to be specified.

Returns:

ISumClause:

ISumClause Interface.

column

(
  • column
)
ISum

Used to provide name of column for which sum will be calculated.

Parameters:

  • column String

    Name of column.

Returns:

ISum:

ISum Interface.

execute

() Object

Used to get sum, this method should be called in last to calculate sum.

Returns:

Object:

Return sum.

executeAsync

(
  • callback
)

Used to get sum asynchronous, this method should be called in last to calculate sum.

Parameters:

  • callback Callback

    Request Callback.

groupBy

(
  • columns
)
ISum

Used to specify GROUP BY statement in conjunction with the aggregate functions to group the result-set by one or more columns.

Parameters:

  • columns Array

    Name of columns.

Returns:

ISum:

ISum Interface.

having

(
  • column
)
ISumClause

Used to specify HAVING clause to SQL because the WHERE keyword could not be used with aggregate functions.

Parameters:

  • column String

    Name of column on which condition need to be applied.

Returns:

ISumClause:

ISumClause Interface.

havingClause

(
  • havingClause
)
ISum

Used to provide manually created Where clause, instead of using API's.

Parameters:

  • havingClause String

    Where clause.

Returns:

ISum:

ISum Interface.

or

(
  • column
)
ISumClause

Used to specify OR condition between where clause.

Parameters:

  • column Column

    Name of column on which condition need to be specified.

Returns:

ISumClause:

ISumClause Interface.

where

(
  • column
)
ISumClause

Column name of which condition will be specified.

Parameters:

  • column String

    Name of column.

Returns:

ISumClause:

ISumClause Interface.

whereClause

(
  • whereClause
)
ISum

Used to provide manually created Where clause, instead of using API's.

Parameters:

  • whereClause String

    Manually created where clause.

Returns:

ISum:

ISum Interface.