- [Simple]
- [Lateral join]
- [CTE (nested)]
- [Crosstab]
- [Values select]
- [Values join]
- [CTE]
- [Complex]
- [Complicated]
- [Aggregation]
- [Join]
- [Generate Series]
- Docs
- Why?.
YAML
declare:
eql:
operator: =
left: $1
value: $2
get_sum:
operator: $1
sum:
apply: ["get_sum", "sum"]
args:
- $1
group_by:
field: $1
main:
from: payments
alias: p
distinct: true
select:
- apply: ["sum", "i.views"]
- apply: ["sum", "i.clicks"]
- apply: ["sum", "p.amount"]
where:
- apply: ["eql", "user_id", "12"]
group:
- apply: ["group_by", "date"]