cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Razumovsky <razumovsky.and...@gmail.com>
Subject EJBQL: clause for count() statement?
Date Thu, 28 Jan 2010 10:47:27 GMT
Hi,

Imagine I need to select all artists with their painting count. That's how I
do that
select a, count(p) from Artist a inner join a.paintings p group by a

I need to select all artists that have >5 paintings... how can I do that? I
thought I need something like aliases, but our EJBQL doesn't support it:
select a, count(p) AS pCount from Artist a inner join a.paintings p where
pCount>5 group by a

Is there any way to do that?
-- 
Andrey

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message