title: Filter count table query
body: <p>i have 2 tables as following.</p>
  
  <p>User</p>
  
  <pre><code>id         name 
  ---------------
  1          john
  2          raju
  3          manu
  4          raghu
  </code></pre>
  
  <p>friendtable</p>
  
  <pre><code>id  userid       recvId
  ------------------------
  1   1         2
  2   1         3
  3   2         3
  4   3         4
  </code></pre>
  
  <p>Is it possible to filter users by their friends count from  these tables.Please help me.</p>
  
  <p>For eg :- range >=3 will result  : john,manu</p>
  
  <p>range >3 and range &lt;2 will result : raju
  range &lt;2  result : raghu</p>