Mode

Description

Computes the mode value of an aggregation of values. Mode is the most frequent value.

Syntax

Mode (n )

Arguments

n is a numeric, string, or date expression.

Example

This query returns the mode and average of each continent's female population.

select Mode(Pop_Fem) as ModePopulation, Avg(Pop_Fem) as Average from countries

Remarks

Mode is an aggregation function which can only be used in an aggregating SELECT statement. Null values are ignored. If there are only null values supplied in the aggregation, then a null value is returned. In the case of multiple modes, null value is returned.

See also http://en.wikipedia.org/wiki/Mode_(statistics).