code_sql_group_by: Aggregate Grouped Records

View source: R/code_sql_group_by.R

code_sql_group_byR Documentation

Aggregate Grouped Records

Description

SQL Code to get aggregated statistics for groups

Usage

code_sql_group_by(
  sql,
  aggregator.cols,
  group.by.cols,
  include.all.possible.combos = FALSE
)

Arguments

sql

SQL which selects records

aggregator.cols

the aggregation rules to apply for each measure (ie: count(*) AS N)

group.by.cols

the columns that you wish to group by

include.all.possible.combos

when TRUE does group by statements for every possible combo and then uses UNION to put them all together.


MattjCamp/Coder documentation built on April 28, 2023, 4:53 p.m.