Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] SUM in HAVING clause

hi,

i just downloaded the new eclipselinks 1.0. afaik it's based on oracle toplink and it still has problems with SUM in the HAVING clause.

the following query:

select new ch.brj.ekv.type.KaufShort(k.id, k.datum, k.einkaufer.name, SUM(p.betrag))
from Kauf k, in(k.posten) p
where k.datum between :datVon and :datBis
group by k.id, k.datum, k.einkaufer.name
having SUM(p.betrag) between :betrVon and :betrBis
order by k.datum asc

results in an error with this message:

"The HAVING clause must specify search conditions over the grouping items or aggregate functions that apply to grouping items."

the only item i use in the having-clause is the aggregate SUM(p.betrag).
could you please tell me what's wrong here ? does it violate the JPQL spec ?

btw this query works with hibernate.

jakob

ps: i have posted the same question in the oracle toplink forums in 2006 and 2007 (google for toplink having sum)


Back to the top