scrapperstoo
Lurker
Beginner Android dev here - so please forgive me if this is a stupid question!
I have a table from which I am trying to display a single column only, with no duplication.
The results then get displayed in a list via a SimpleCursorAdapter.
I need to keep the rowid column in the results to allow the list to display, but if I do, then the "distinct" part of the query doesn't have any effect - because each rowid is obviously unique.
Any chance someone can point me in the right direction?
Cheers
I have a table from which I am trying to display a single column only, with no duplication.
Code:
public Cursor fetchUniqueMembers(String colKey) throws SQLException {
String[] cols = new String[] {KEY_ROWID, colKey};
Cursor mCursor =
mDb.query(true, DATABASE_TABLE, cols, null, null, null, null, colKey + " ASC", null);
if (mCursor != null) {
mCursor.moveToFirst();
}
return mCursor;
}
The results then get displayed in a list via a SimpleCursorAdapter.
I need to keep the rowid column in the results to allow the list to display, but if I do, then the "distinct" part of the query doesn't have any effect - because each rowid is obviously unique.
Any chance someone can point me in the right direction?
Cheers
