title: How to generate "select count(*)as y from (select distinct x, y from tableName) as t" using NH?
body: <p>Any ideas on how to generate the follow query with Nhibernate using the Criteria API?</p>
  
  <pre><code>select count(*)as z from (select distinct x, y from tableName) as t
  </code></pre>
  
  <p>or </p>
  
  <pre><code>select count(distinct (x , y)) as z FROM tableName
  </code></pre>
  
  <p>or</p>
  
  <p>some other query that returns the same results.</p>