Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groupby should accept functions, e.g. datetrunc #162

Closed
neilotoole opened this issue Mar 26, 2023 · 1 comment
Closed

groupby should accept functions, e.g. datetrunc #162

neilotoole opened this issue Mar 26, 2023 · 1 comment
Assignees

Comments

@neilotoole
Copy link
Owner

There's currently no way to express this SQL query as SLQ.

select date_trunc('month', payment_date) as onthisdate, count(payment_id) as count from payment
group by date_trunc('month', payment_date)

That is to say, groupby should accept functions, e.g.

sq '.payment | date_trunc('month', .payment_date):onthisdate, count(.payment_id):count | groupby(date_trunc('month', .payment_date))
@neilotoole
Copy link
Owner Author

This is implemented. See query guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant