发布日期: 04/13/2021

Aggregate SQL Functions

When passing a single argument to an aggregate function, that argument can be preceded by the keyword DISTINCT, which filters out duplicate values.

For all aggregations other than COUNT( * ), NULL and missing values are ignored.

Function

SQLite

Description

AVG( num_expr )

 

Computes the average of num_expr for the rows in the group. Num_expr must be numeric.

COUNT( expr )

COUNT( * )

 

Counts the number of times expr is not NULL in the group. COUNT( * ) returns the total number of rows in the group.

GROUP_CONCAT( expr, <separator = ’,’> )

Yes

Concatenates all non-NULL values of expr and returns them as a string. Numeric values of expr are converted to character. If separator is present, it is placed between the values. The default separator is a comma. DISTINCT can be used only with GROUP_CONCAT() if separator is not specified.

MAX( expr )

 

Returns the maximum value of expr in the group. Expr can be character or numeric.

MIN( expr )

 

Returns the minimum value of expr in the group. Expr can be character or numeric.

STDDEV_POP( num_expr )

 

Computes the population standard deviation of num_expr for the group.

STDDEV_SAMP( num_expr )

 

Computes the sample standard deviation of all num_expr for the group.

SUM( num_expr )

 

Returns the sum of num_expr for the group. If no non-NULL values are found, SUM() returns NULL.

TOTAL( num_expr )

Yes

Same as SUM( num_expr ), except TOTAL() returns 0.0 if no non-NULL values are found.

VAR_POP( num_expr )

 

Computes the population variance of num_expr for the group.

VAR_SAMP( num_expr )

 

Computes the sample variance of num_expr for the group.

 

需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).