TDV Adapter for Google Spanner

Build 22.0.8462

Aggregate Functions

Examples of Aggregate Functions

Below are several examples of SQL aggregate functions.

COUNT(DISTINCT)

Returns the number of distinct, non-null field values matching the query criteria.

SELECT COUNT(DISTINCT Name) AS DistinctValues FROM [CData].[GoogleSpanner].Customer WHERE CustomerId = '12345'

AVG

Returns the average of the column values.

SELECT  AVG(AnnualRevenue) FROM [CData].[GoogleSpanner].Customer WHERE CustomerId = '12345'

MIN

Returns the minimum column value.

SELECT MIN(AnnualRevenue) FROM [CData].[GoogleSpanner].Customer WHERE CustomerId = '12345'

MAX

Returns the maximum column value.

SELECT  MAX(AnnualRevenue) FROM [CData].[GoogleSpanner].Customer WHERE CustomerId = '12345'

SUM

Returns the total sum of the column values.

SELECT SUM(AnnualRevenue) FROM [CData].[GoogleSpanner].Customer WHERE CustomerId = '12345'

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462