Can anyone help me how to execute this query?
I am trying to fetch distinct supervisor from project table. supervisor is column name and its index is 5.
try {
String query = "select distinct supervisor from project ";
Cursor cursor= db.rawQuery(query,null);//query( query , null, null,null,null,null,null);
if (cursor.moveToFirst()) {
do {
labels.add(cursor.getString(5));
} while (cursor.moveToNext());
}
// finish();
cursor.close();
db.close();
} catch (Exception ex) {
ex.printStackTrace();
}
return labels;
}