qt_basic: The most basic query pattern

View source: R/qt.R

qt_basicR Documentation

The most basic query pattern

Description

The most basic query pattern

Usage

qt_basic(
  select_cols,
  table_name,
  where = NULL,
  group_by = NULL,
  order_by = NULL,
  limit = NULL
)

Arguments

select_cols

vector of columns to select. Names will be used as identifiers, if supplied

table_name

table to select from

where

vector of constraints to be joined with 'and'

group_by

vector of columns to group by

order_by

vector of columns to order by

limit

number of rows to return

Value

a filled query

Examples

qt_basic(
   select_cols = c(Date = "saledate", "Country", Sales = "SUM(sales)"), 
   table = "all_sales",
   where = c("country in ('US', 'CA')", "year = 2020"),
   group_by = c("saledate", "country"),
   order_by = "Date")

colin-fraser/queries documentation built on April 14, 2022, 2:12 p.m.