Joined: Thu Oct 08, 2009 9:07 pm Posts: 1
|
How can one do arithmetic on scalar resultsets in hql? Consider a 1:n parent->child relationship:
select (select count(*) from Child where parent = p) from Parent p
works just fine.
select 1 + (select count(*) from Child where parent = p) from Parent p
doesn't. This type of thing is valid in sql. Is there a way to achieve this or have I missed something? And don't put the '1' in the subselect, you crafty little cur. What I really want to do is add the results of two moderately complex subselects.
|
|