Any ideas 开发者_C百科on how to generate the follow query with Nhibernate using the Criteria API?
select count(*)as z from (select distinct x, y from tableName) as t
or
select count(distinct (x , y)) as z FROM tableName
or
some other query that returns the same results.
You can try to generate such a query with the help of ICriteria API and Projection. What you are going to need are Projections.RowCount()
, Projections.Distinct()
, Projections.Property()
精彩评论