This page has more details on the supported SQL in simple-sql-parser.
See the simple-sql-parser test cases page for examples.
The target dialect of SQL at this time is ISO/ANSI SQL:2011. The parser only supports queries. The parser and syntax does not follow the standard grammar closely - they permit a lot of things which the grammar in the standard forbids. The intended usage is that an additional pass over the ast can be made if you want to carefully prohibit everything that the standard doesn't allow.
Apart from this permissiveness, some work has been put into trying to get the best parser error messages possible.
Although the parser and syntax support some character set constructs, any source is always parsed in the default system encoding which Haskell uses, and any encoding/decoding is left to the system. I think this effectively means that you will usually be using utf-8 character set for the sql source.
Supports value expressions, aliases with optional 'as'.
Doesn't support 'select * as (a,b,c) from t' yet.
Supports 'select distinct' and explicit 'select all'.
Supports value expressions, group by (), cube, rollup, grouping parentheses and grouping sets with nested grouping expressions.
Supports value expressions, asc/desc and nulls first/last.
Supports 'offset n rows' and 'fetch first n rows only'.
Union, except, intersect + all/distinct and corresponding.
For example: values (1,2),(3,4).
For example: 'table t', which is shorthand for 'select * from t'.
The value expressions type and parser is used in many contexts, including:
This doesn't exactly follow the ANSI Standards, which have separate grammars for most of these.
The supported value expressions include: