Hql query: sum of two subselects

what's wrong with this HQL query:

select ( ( select sum(base)/8 FROM com.agitech.erp.model.rhp.RhpEmployeRubric where ...) + ( select sum(base)/8 FROM com.agitech.erp.model.rhp.RhpEmployeRubric where ...) ) 

An exception:

 unexpected end of subtree 

I will also try

 select ( select sum(base)/8 FROM RhpEmployeRubric where ...) as sum1, ( select sum(base)/8 FROM RhpEmployeRubric where ...) as sum2 

same exception!

0
hibernate hql
source share

No one has answered this question yet.

See similar questions:

6
SQL conversion with subquery in HQL selection

or similar:

636
What is the difference between JPA and Hibernate?
one
HQL: multiple internal joins in HQL queries
one
HQL: select the sum group by compound
0
HQL QuerySyntaxException Exception
0
Hibernation request to select records based on date?
0
How to combine the results of two HQL queries into one
0
HQL Choice Wrong Path Exception
0
Using Subqueries in HQL
0
HQL subprocess in select statement
0
Why is my HQL query request "should start with select or from"?

All Articles