Skip to content

Instantly share code, notes, and snippets.

@PMeinshausen
Created September 18, 2014 11:51
Show Gist options
  • Select an option

  • Save PMeinshausen/b35dea788fbcaa25c756 to your computer and use it in GitHub Desktop.

Select an option

Save PMeinshausen/b35dea788fbcaa25c756 to your computer and use it in GitHub Desktop.
--Syntax (version 1.0)
SELECT [ALL | DISTINCT [ON (expression [, ...])]]
* | expression [[AS] output_name] [, ...]
FROM NPATH(on_clause1 [on_clause2 ... on_clausen]
PARTITION BY expression [, ...]
ORDER BY expression [ASC | DESC] [,...]
MODE({OVERLAPPING | NONOVERLAPPING}) PATTERN('pattern_of_symbols')
SYMBOLS(symbol_predicate AS symbol [, ...])
[FILTER(filter_expression[, ...])]
RESULT(aggregate_function(expression OF symbol) AS alias [, ...])
) [, ...]
[WHERE condition]
[GROUP BY expression [, ...]]
[HAVING condition [, ...]]
[ORDER BY expression [ASC | DESC][NULLS {FIRST | LAST}][, ...]] [LIMIT {count | ALL}]
[OFFSET start];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment