I'm working with SQLite on Android.
I used ContentProvider
to query data from db.
And now, I have a problem when try to use subquery via ContentResolver
String selection = "cat_id NOT IN ?"
String[] selectionArgs = new String[]{"(SELECT Categories.id FROM Categories)"}
cursor = mResolver.query(getContentUri(), getListColumns(),
selection, selectionArgs, orderBy);
And this is the error:
08-06 10:32:36.070: E/AndroidRuntime(2151): Caused by: android.database.sqlite.SQLiteException: near "?": syntax error (code 1): , while compiling: SELECT * FROM TRANSACTIONS WHERE cat_id NOT IN ? ORDER BY time_created ASC, id ASC`
My question is "Can I use selectionArgs be a Subquery?"
My purpose is "get the list of transactions where cat_id is NOT IN a Category table".
Who can help me?