SELECT: Generate SELECT statement snippets

Description Usage Arguments Functions Examples

View source: R/sqrrl.R

Description

Generate an SQL snippet for SELECT or SELECT DISTINCT

Usage

1
2
3
4
5
SELECT(..., .distinct = FALSE)

SELECT_(table_cols = NULL, .distinct = FALSE)

SELECT_DISTINCT(...)

Arguments

...

Columns to select. Single arguments are assumed to be column names. Single named arguments are renamed columns. Named arguments with a vector of length greater than 1 or a vector with named entries are assumed to be table names; entry names are column aliases.

.distinct

If true, uses SELECT DISTINCT as keyword

table_cols

Named list of tables and columns

Functions

Examples

1
2
3
4
5
6
7
SELECT(letters[1:3])
SELECT(letters[1:3], 't2' = letters[4:6])
SELECT(a = 'apple', b = 'banana', c = 'cherry')
SELECT('t1' = c(a = 'apple', b = 'banana'), c = 'cherry')
SELECT('t1' = c(a = 'apple', b = 'banana'), c = 'cherry', 't2' = c(d = 'dragon_fruit'))

SELECT_(list('t1' = c('a', z = 'b'), 't2' = 'c'))

gadenbuie/sqrrrl documentation built on May 24, 2019, 4:04 a.m.