title: Android Cursor Query Count
body: <p>I'm developing a small application that reads data from a database and displys it in a few custom listview layouts.</p>
  
  <p>I got all my ducks in a row but have one issue where I can't wrap my mind around which is preforming a count within the cursor query</p>
  
  <p>Here is a simple example of my code</p>
  
  <pre><code>private static final String fields[] = { "CarYear","CarMake","CarModel","CarInfo", BaseColumns._ID }; //BaseColumns._ID
  </code></pre>
  
  <p>And the query itself</p>
  
  <pre><code>                Cursor data = database.query("Car060", fields, null, null, null, null,null);
  </code></pre>
  
  <p>So the big question is how can I either preform a total count per maker or just a total count.</p>
  
  <p>Thanks for any assistance</p>
  
  <p>Ended up using a RawQuery</p>
  
  <p>Cursor Count = database.rawQuery("SELECT COUNT(DISTINCT People) as NumberOfPeople FROM WhatEverDB", null);</p>