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

FILTER clause in SELECT clause #507

Closed
yankyhgoflow opened this issue Jul 6, 2021 · 3 comments
Closed

FILTER clause in SELECT clause #507

yankyhgoflow opened this issue Jul 6, 2021 · 3 comments
Projects

Comments

@yankyhgoflow
Copy link
Contributor

In SQL we can add a FILTER clause to an aggregate SELECT clause, i.e.

SELECT [item], SUM([price]) AS [total], SUM([price]) FILTER ( WHERE [date] >= '2021-01-01' ) AS [sales2020]
FROM [orders]
GROUP BY [item]

It would be a huge help if SqlKata can support passing WHERE clauses with their bindings to a SELECT clause.

@ahmad-moussawi ahmad-moussawi added this to To do in Tasks Jul 16, 2021
@generik0
Copy link

WhereRaw? Can you not do it with that?

@yankyhgoflow
Copy link
Contributor Author

yankyhgoflow commented Feb 1, 2022

WhereRaw works on the overall query level, I am referring to the FILTER clause available on aggregate expressions.
postgres docs

@ahmad-moussawi
Copy link
Contributor

Support added will be available in the next release

Tasks automation moved this from To do to Done Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Tasks
Done
Development

No branches or pull requests

3 participants