-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support for DISTINCT
usage in aggregates
#326
Comments
DISTINCT
usage in aggregation column selectionDISTINCT
usage in aggregates
It's true that we do allow Unless someone can convince me that |
I don't know what it was at the time of writing. I guess the data could have been a result of a subquery. Now I can't think of anything practical, maybe one of the upvoters can. |
@beikov, @andyjefferson, @dazey3, @TomBeckett you all voted for this. Can someone describe a legit usecase for it? |
Sorry, I don't remember what it was that drove me to upvoting this ticket. Maybe consistency with JPQL? I can't think of a real usecase for this feature. |
Thanks. I'm going to close it then. If someone can think of something, it can always be reopened. |
Hi, I have a usecase for this: We would like to aggregate all possible values that exist in a column, so we could distribute the values using powers of two which allows us to trace back to the individuals but ONLY if they are distinct before the sum. @andyjefferson, @dazey3, @TomBeckett any of you remember your usecases? |
Without DISTINCT
For a query like
you can write the equivalent
CriteriaQuery
With DISTINCT
But for a query like
I suggest adding the following method to
CriteriaBuilder
so we could write
as currently there does not seem to be a way to achieve this. A
countDistinct
method exists, but what aboutDISTINCT
for other aggregates?The text was updated successfully, but these errors were encountered: