TurboSQL Guide

Aggregation Functions

Previous  Top  Next


This is a list of aggregation functions that can be used in TurboSQL.

AVG

Syntax

AVG(column_reference)

Description

Calculates the average of the values in the column. The argument must be a numeric type. The result is always a a FLOAT.

COUNT

Syntax

COUNT(*|column_reference)

Description

Calculates the number of rows in the column. The argument can be of any type. The result is always a BIGINT.

Examples

COUNT(*)
COUNT(NAME)

MAX

Syntax

MAX(column_reference)

Description

Calculates the maximum of the values in the column. The argument must be a numeric type or a date/time type. The result is a super-type of the argument type.

MIN

Syntax

MIN(column_reference)

Description

Calculates the minimum of the values in the column. The argument must be a numeric type or a date/time type. The result is a super-type of the argument type.

STDDEV

Syntax

STDDEV(column_reference)

Description

Calculates the standard deviation of the values in the columns. The argument must be numeric type. The result is always a FLOAT.

Example

SELECT AVG(Value), STDDEV(Value) FROM Values

Compatibility Information

This function is only available in TurboDB Managed.

SUM

Syntax

SUM(column_reference)

Description

Calculates the sum of the values in the column. The argument must be a numeric type. The result is a super-type of the argument type.

See also

General Functions and Operators
Arithmetic Functions and Operators
String Functions and Operators
Date and Time Functions and Operators
Aggregation Functions
Miscellaneous Functions and Operators
User-defined Aggregates