title: How to return count from ODATA result set
body: <p>I am trying to get a count of my records from an Olingo ODATA (version 2) result set similar to the one below:</p>
  
  <p><a href="http://services.odata.org/OData/OData.svc/Categories/" rel="nofollow">http://services.odata.org/OData/OData.svc/Categories/</a>$count</p>
  
  <p>The above url returns 3, and there are 3 'values' as you can see if you remove the <code>/$count</code>.</p>
  
  <p>I am working on local host, where this url:</p>
  
  <pre><code>localhost/odata/livingODATA/address/
  </code></pre>
  
  <p>returns a result set, but <code>localhost/odata/livingODATA/address/$count</code> returns the error:</p>
  
  <pre><code>TEIID30088 Unrelated order by column g0.id cannot be used in a SET query, with SELECT DISTINCT, or GROUP BY
  </code></pre>
  
  <p>I have tried adding an <code>order by</code>, nothing seems to help.</p>