Reputation: 11
I have a query I am running using SQLiteDatabase.rawQuery
which is grouped and doesn't necessarily have a field I can alias as the required _id field needed by the Cursor. Seeing that MySQL doesn't support the rowid function, is there another way around this to avoid the following exception java.lang.IllegalArgumentException: column '_id'
does not exist. Also I am using a custom adapter to display these results in a ListView.
Upvotes: 1
Views: 1705
Reputation: 16082
You must be extending CursorAdapter which demand _id column.
Example:
SELECT id _id, name, address FROM user
Example:
SELECT 1 _id, name, address FROM user
Upvotes: 6