title: HQL - select count from select
body: <p>I would like to be able to count the amount of records returned in another query. Using SQL it's easy:</p>
  
  <pre><code>select count (*) 
  from  (
    select count(first_name) 
    from users 
    group by first_name) as temp
  </code></pre>
  
  <p>Does anyone have any idea how can I do that using HQL?</p>