Maybe it can be done... Without requiring that the whole student
instance be returned also, in one query, it would be simple.

Can you use the sql as is with CreateSqlQuery()?

/Oskar


2009/10/28 Michal Drozd [toper] <[email protected]>:
>
> Any ideas? the sql seems simple:
>
> select p.*, isnull(c.cnt, 0)
> from parent p
>  left join (select parentid, count(childid) as cnt from children
> group by parentid) c on p.id = c.parentid
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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