Group By

Table of Contents

Overview
Group by allows you to select a result set and group it (or collapse the results) by a given set of fields. Remaining non-grouped fields are availale only to Aggregate Functions.

Examples
round-pushpin Selects and groups by the SourceWordId from the Synonym schema and performs various aggregations.
SELECT
    SourceWordId,
    Min(TargetWordId) as Min,
    Max(TargetWordId) as Max,
    Sum(TargetWordId) as Sum,
    Avg(TargetWordId) as Avg,
    Count(TargetWordId) as Count
FROM
    WordList:Synonym 
GROUP BY
    SourceWordId


Related