title: How to select distinct values from one column in table?
body: <p>I am developing a restaurant menu app in Android. My app has one database table which has the following columns:</p>
  
  <ul>
  <li>id (primary key)</li>
  <li>category</li>
  <li>item name</li>
  </ul>
  
  <p>The category column shows the category of item such as veg, non veg, snacks etc. It has duplicate values and I want to select only distinct values from this column. I have tried the following but it is not working if anyone can provide a solution:</p>
  
  <pre><code>String query = "SELECT DISTINCT category FROM todo";
  
  Cursor  cursor = database.rawQuery(query,null);
  if (cursor != null) {
      cursor.moveToFirst();
  }
  
  return cursor; 
  </code></pre>