如何使用NH生成“select count(*)as y from(select table x,y from tableName)as t”?

时间:2010-11-08 23:14:44

标签: c# nhibernate

有关如何使用Criteria API使用Nhibernate生成跟随查询的任何想法吗?

select count(*)as z from (select distinct x, y from tableName) as t

select count(distinct (x , y)) as z FROM tableName

返回相同结果的其他一些查询。

1 个答案:

答案 0 :(得分:3)

您可以尝试在ICriteria API和Projection的帮助下生成此类查询。您需要的是Projections.RowCount()Projections.Distinct()Projections.Property()

相关问题