1
Fork 0

add filter and within group aggregates

This commit is contained in:
Jake Wheat 2014-04-19 18:01:49 +03:00
parent 59826ecce2
commit 7057241974
5 changed files with 129 additions and 21 deletions
Language/SQL/SimpleSQL

View file

@ -52,7 +52,7 @@ which have been changed to try to improve the layout of the output.
> valueExpr (App f es) = names f <> parens (commaSep (map valueExpr es))
> valueExpr (AggregateApp f d es od) =
> valueExpr (AggregateApp f d es od fil) =
> names f
> <> parens ((case d of
> Distinct -> text "distinct"
@ -60,6 +60,15 @@ which have been changed to try to improve the layout of the output.
> SQDefault -> empty)
> <+> commaSep (map valueExpr es)
> <+> orderBy od)
> <+> me (\x -> text "filter"
> <+> parens (text "where" <+> valueExpr x)) fil
> valueExpr (AggregateAppGroup f es od) =
> names f
> <> parens (commaSep (map valueExpr es))
> <+> if null od
> then empty
> else text "within group" <+> parens(orderBy od)
> valueExpr (WindowApp f es pb od fr) =
> names f <> parens (commaSep $ map valueExpr es)