i want to create a sqlite cursor who u can handle an inner-join query using the contextResolver.
this is my current cursor:
Cursor cursor = getContentResolver().query(Exercise.CONTENT_URI, new String[]{Exercise.Columns._ID, Exercise.Columns.EXERCISE_NAME, Exercise.Columns.DONE_LAST},
"",null, Exercise.Columns.DONE_LAST);
My new Cusor should handle something like this:
private final String MY_QUERY =
"SELECT a."+Exercise.Columns.EXERCISE_NAME+", a."+Exercise.Columns.DONE_LAST+", b."+Progress.Columns.WEIGHT+", " +
"b."+Progress.Columns.SETS+", b."+Progress.Columns.REPITITIONS+" " +
"FROM "+Exercise.TABLE_NAME+" a " +
"INNER JOIN "+Progress.TABLE_NAME+" b " +
"ON a.+"+Exercise.Columns._ID+" = b."+Progress.Columns._ID +
"WHERE b.+"+Progress.Columns.WHENDONE+" = ( Select MAX (b."+Progress.Columns.WHENDONE+") from b";
If found some solutions in SOV - they all use rawQuery, but i dont have an SQLiteOpenHelper object in my activity. So is there another Solution, executing this query by getContentResolver()?
Many Thanks for your help
greetings pebbles
Aucun commentaire:
Enregistrer un commentaire