Aggregation with Groups

Aggregate the value with groupings


Aggregation example shows how to aggregate the value across the entire table. This example shows how to aggregate only a part of the table. GROUP BY allows you to separate data into groups which can be aggregated independent of one another.

Sample Input

item category price
banana fruit 1
apple fruit 1.2
desk furniture 420
TV electronics 500
iPod electronics 120


to view this query

Sample Output

category cnt sum
fruit 2 1.1
furniture 1 420
electronics 2 310