[jboss-jira] [JBoss JIRA] (WFLY-5573) DISTINCT does not work with aggregate functions in JPQL

Scott Marlow (JIRA) issues at jboss.org
Fri Oct 23 11:02:00 EDT 2015


    [ https://issues.jboss.org/browse/WFLY-5573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13121589#comment-13121589 ] 

Scott Marlow commented on WFLY-5573:
------------------------------------

Also check out other Hibernate ORM resources via [http://hibernate.org/community]

> DISTINCT does not work with aggregate functions in JPQL
> -------------------------------------------------------
>
>                 Key: WFLY-5573
>                 URL: https://issues.jboss.org/browse/WFLY-5573
>             Project: WildFly
>          Issue Type: Bug
>          Components: JPA / Hibernate
>    Affects Versions: 10.0.0.CR2
>            Reporter: Steve Fisher
>            Assignee: Scott Marlow
>
> The JPQL: SELECT SUM(DISTINCT df.fileSize) from Datafile df is, I believe, valid but is rejected with: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: DISTINCT near line 1, column 14 [SELECT SUM ( DISTINCT df.fileSize ) FROM org.icatproject.core.entity.Datafile df]
> I see that the documentation only states that COUNT(DISTINCT .. will work. However all the aggregate functions should accept the DISTINCT keyword.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list