Is a projection query like this possible in NH?

select
 a.*,
 al.cnt,
 aol.cnt
from A a
left outer join (
  select id, count(*) as cnt from ALogs al group by id
) al on a.id = al.id
left outer join (
  select id, count(*) as cnt from AOtherLogs aol group by id
) aol on a.id = aol.id


As far as I can tell, I can only do a column sub-query (inefficient)
or I can do the aggregate in the main select (fails when I need
multiple aggregates, also somewhat inefficient to group by loads of
columns).

I've been mapping views to do this, but have been wondering if it is
possible with ICriteria + DetachedCriteria.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to