简单的NHibernate子查询 - 拉出我的头发

时间:2010-12-20 18:06:44

标签: c# nhibernate

我想要做的就是查找一个值并在子查询中返回

select 
(select top 1 c.Type from ChangeTypes c where c.TypeID = r.ChangeType) as ChangeType,
COUNT(r.requestId) as RequestCount
from Request r 
group by ChangeType

我不能让这个为我的生活工作......

非常感谢任何帮助!

1 个答案:

答案 0 :(得分:0)

尝试与

类似的内容
select
    (select c.Type
     from ChangeTypes c
     where c.Type.Id = r.ChangeType.Id) as rtypes,
    count(r.Requests) as rcount
from Request r
group by rtypes