19 lines
574 B
Plaintext
19 lines
574 B
Plaintext
PivotStatement <- PivotKeyword TableRef PivotOn? PivotUsing? GroupByClause?
|
|
|
|
PivotOn <- 'ON' PivotColumnList
|
|
PivotUsing <- 'USING' TargetList
|
|
|
|
PivotColumnList <- List(Expression)
|
|
|
|
PivotKeyword <- 'PIVOT' / 'PIVOT_WIDER'
|
|
UnpivotKeyword <- 'UNPIVOT' / 'PIVOT_LONGER'
|
|
|
|
UnpivotStatement <- UnpivotKeyword TableRef 'ON' TargetList IntoNameValues?
|
|
|
|
IntoNameValues <- 'INTO' 'NAME' ColIdOrString ValueOrValues List(Identifier)
|
|
|
|
ValueOrValues <- 'VALUE' / 'VALUES'
|
|
|
|
IncludeExcludeNulls <- ('INCLUDE' / 'EXCLUDE') 'NULLS'
|
|
UnpivotHeader <- ColIdOrString / Parens(List(ColIdOrString))
|