Reputation: 7249
Any ideas 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.
Upvotes: 3
Views: 313
Reputation: 15227
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()
Upvotes: 3