of course, i've tried, it didn't run giving:
aggregate function expected before ( in SELECT [select (1 / suggestion.numberOfAuthors) from ots.domain.Suggestion as suggestion]
when i change the query into this
select sum(1/suggestion.numberOfAuthors) from Suggestion as suggestion
it worked. in fact this was what i wanted. i was just trying withot aggregate functions before it gets too complicated.
now again there seems to be some problem with mathematical expressions in select clause. when i try to use a value that is returned by a subquery in select clause:
select sum(1.0 / (select size(suggestion2.authors) from Suggestion as suggestion2 where suggestion2=suggestion)), personnel.department from Suggestion as suggestion join suggestion.authors as suggestion_author join suggestion_author.personnel as personnel join personnel.department as dept group by dept
The error message given is:
net.sf.hibernate.QueryException: ( expected before ) in select [select sum(1.0 / (select ....
|