cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Order by count
Date Mon, 16 Aug 2010 08:12:19 GMT
Oddly (to me at least) JPQL spec does not allow aggregate or other  
functions in ORDER BY. This was discussed just recently on this list:

http://markmail.org/message/ztlqde7brhamdzrf

Something for us to consider adding in the future versions of Cayenne,  
as we are no longer bound by the spec limitations.

Andrus

On Aug 15, 2010, at 3:28 PM, Marek Šabo wrote:

> Hi,
>
> I'm not sure but is there support in Cayenne EJBQL impl. for  
> ordering by
> aggregate functions? (I think JPQL spec. has it)
>
> I'm getting syntax error on these:
>
> SELECT p.account, count(p) FROM PortJump p GROUP BY p.account, ORDER  
> by
> count(p) DESC
>
> SELECT p.account, count(p) AS cnt FROM PortJump p GROUP BY p.account
> ORDER BY cnt DESC
>
> Thanks for information, regards
>
> -- 
> Marek Šabo
>
>


Mime
View raw message