title: Select Count in Realm for Android
body: <p>I saw some answers about this problem for iOS <a href="https://stackoverflow.com/questions/31906563/how-to-perform-realm-count-query">(here)</a>, but none for Android.</p>
  
  <p>Let's say I have 2 columns A and B and I want the distincts couples of A and B and the count of the couple. I then want to filter my query when the count is &lt;60.</p>
  
  <pre><code>A|B
  1|1
  1|1
  1|1
  2|1
  2|1
  2|1
  1|2
  1|2
  1|2
  1|2
  </code></pre>
  
  <p>In pure SQL, I used the query :</p>
  
  <pre><code>SELECT A,B, COUNT(A) FROM myTable GROUP BY A,B
  </code></pre>
  
  <p>Which give me something like [(1,1,3), (2,1,3), (1,2,4)]</p>
  
  <p><strong>How can I do so with Realm in Android ?</strong></p>