SICIAverage Protocol Reference

Conforms to NSObject
Declared in SICIAverage.h

Overview

Exposes API’s to get average value of all non-NULL X within a group.

String and BLOB values that do not look like numbers are interpreted as 0. The result of avg()is always a floating point value as long as at there is at least one non-NULL input even if all inputs are integers. The result of avg()is NULL if and only if there are no non-NULL inputs.

– where: required method

Column name of which condition will be specified.

- (id<SICIAverageClause>)where:(NSString *)column

Parameters

column

Name of column.

Return Value

SICIAverageClause Interface.

Discussion

Column name of which condition will be specified.

Declared In

SICIAverage.h

– whereClause: required method

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

- (id<SICIAverage>)whereClause:(NSString *)whereClause

Parameters

whereClause

Manually created where clause.

Return Value

SICIAverage Interface.

Discussion

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

Declared In

SICIAverage.h

– and: required method

Used to specify AND condition between where clause.

- (id<SICIAverageClause>)and:(NSString *)column

Parameters

column

Name of column on which condition need to be specified.

Return Value

SICIAverageClause Interface.

Discussion

Used to specify AND condition between where clause.

Declared In

SICIAverage.h

– or: required method

Used to specify OR condition between where clause.

- (id<SICIAverageClause>)or:(NSString *)column

Parameters

column

Name of column on which condition need to be specified.

Return Value

SICIAverageClause Interface.

Discussion

Used to specify OR condition between where clause.

Declared In

SICIAverage.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<SICIAverage>)groupBy:(NSArray *)columns

Parameters

columns

Name of columns.

Return Value

SICIAverage 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

SICIAverage.h

– having: required method

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

- (id<SICIAverageClause>)having:(NSString *)column

Parameters

column

Name of column on which condition need to be applied.

Return Value

SICIAverageClause Interface.

Discussion

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

Declared In

SICIAverage.h

– havingClause: required method

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

- (id<SICIAverage>)havingClause:(NSString *)havingClause

Parameters

havingClause

Where clause.

Return Value

SICIAverage Interface.

Discussion

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

Declared In

SICIAverage.h

– column: required method

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

- (id<SICIAverage>)column:(NSString *)column

Parameters

column

Name of column.

Return Value

SICIAverage Interface.

Discussion

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

Declared In

SICIAverage.h

– execute required method

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

- (id)execute

Return Value

Return average.

Discussion

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

Exceptions

SICDatabaseException

Throws exception if any error occur while calculating average.

Declared In

SICIAverage.h