File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -379,6 +379,30 @@ Complex grouping operations are often equivalent to a `UNION ALL` of simple
379379does not apply, however, when the source of data for the aggregation
380380is non-deterministic.
381381
382+ ### AUTO
383+
384+ ` AUTO ` syntax implicitly groups on every column not included in an aggregation
385+ function.
386+
387+ This query sums the account balance (` acctbal ` ) for each market segment
388+ (` mktsegment ` ), with ` AUTO ` automatically determining the grouping
389+ keys:
390+
391+ ``` sql
392+ SELECT mktsegment, sum (acctbal) FROM shipping GROUP BY AUTO;
393+ ```
394+
395+ ``` text
396+ mktsegment | _col1
397+ ------------+--------------------
398+ BUILDING | 1444587.8
399+ MACHINERY | 1296958.61
400+ HOUSEHOLD | 1279340.66
401+ FURNITURE | 1265282.8
402+ AUTOMOBILE | 1395695.7200000004
403+ (5 rows)
404+ ```
405+
382406### GROUPING SETS
383407
384408Grouping sets allow users to specify multiple lists of columns to group on.
You can’t perform that action at this time.
0 commit comments