sql_unpivot: Create an unpivot query

Description Usage Arguments

Description

Creates a SQL pivot query. Similar to the tidyr::gather function.

Usage

1
sql_unpivot(con, from, select, key, value, levels, order_by = NULL)

Arguments

con

a Database connection

from

the from clause

select

variables to select in addition to levels.

key

Variable columns originate from

value

The expression to evaluate to create the values

levels

the columns to turn into values of a variable.

order_by

optional order by clause


pivot documentation built on May 2, 2019, 2:02 p.m.