SICISum Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | SICISum.h |
Overview
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.
– where:
required method
Column name of which condition will be specified.
- (id<SICISumClause>)where:(NSString *)column
Parameters
column |
Name of column. |
---|
Return Value
SICISumClause Interface.
Discussion
Column name of which condition will be specified.
Declared In
SICISum.h
– whereClause:
required method
Used to provide manually created Where clause, instead of using API’s.
- (id<SICISum>)whereClause:(NSString *)whereClause
Parameters
whereClause |
Manually created where clause. |
---|
Return Value
SICISum Interface.
Discussion
Used to provide manually created Where clause, instead of using API’s.
Declared In
SICISum.h
– and:
required method
Used to specify AND condition between where clause.
- (id<SICISumClause>)and:(NSString *)column
Parameters
column |
Name of column on which condition need to be specified. |
---|
Return Value
SICISumClause Interface.
Discussion
Used to specify AND condition between where clause.
Declared In
SICISum.h
– or:
required method
Used to specify OR condition between where clause.
- (id<SICISumClause>)or:(NSString *)column
Parameters
column |
Name of column on which condition need to be specified. |
---|
Return Value
SICISumClause Interface.
Discussion
Used to specify OR condition between where clause.
Declared In
SICISum.h
– groupBy:
required method
Used to specify GROUP BY statement in conjunction with the aggregate functions to group the result-set by one or more columns.
- (id<SICISum>)groupBy:(NSArray *)columns
Parameters
columns |
Name of columns. |
---|
Return Value
SICISum Interface.
Discussion
Used to specify GROUP BY statement in conjunction with the aggregate functions to group the result-set by one or more columns.
Declared In
SICISum.h
– having:
required method
Used to specify HAVING clause to SQL because the WHERE keyword could not be used with aggregate functions.
- (id<SICISumClause>)having:(NSString *)column
Parameters
column |
Name of column on which condition need to be applied. |
---|
Return Value
SICISumClause Interface.
Discussion
Used to specify HAVING clause to SQL because the WHERE keyword could not be used with aggregate functions.
Declared In
SICISum.h
– havingClause:
required method
Used to provide manually created Where clause, instead of using API’s.
- (id<SICISum>)havingClause:(NSString *)havingClause
Parameters
havingClause |
Where clause. |
---|
Return Value
SICISum Interface.
Discussion
Used to provide manually created Where clause, instead of using API’s.
Declared In
SICISum.h
– column:
required method
Used to provide name of column for which sum will be calculated.
- (id<SICISum>)column:(NSString *)column
Parameters
column |
Name of column. |
---|
Return Value
SICISum Interface.
Discussion
Used to provide name of column for which sum will be calculated.
Declared In
SICISum.h
– execute
required method
Used to get sum, this method should be called in last to calculate sum.
- (id)execute
Return Value
Return sum.
Discussion
Used to get sum, this method should be called in last to calculate sum.
Exceptions
SICDatabaseException |
Throws exception if any error occur while calculating sum. |
---|
Declared In
SICISum.h