How to query from MEDIA provider with "group by" option?
- by gkshope
I'm a newbie to Android.
Actually, I want to query data from Media provider with Content provider & content resolver.
c = mContent.query(CONTENT_URI,projection,where,null,null);
My question is, how can I query data from media provider as below using a GROUP BY clause:
select DISTINCT _id, count(_id), _data FROM aaa_table WHERE _data LIKE "A" OR _data LIKE "B" GROUP BY _id;
I have tried setting projection and where as follows:
final String[] projection = new String[] {
"_id",
"COUNT ("+ _id +")" ,
"_data"
};
and where:
_data LIKE "A" OR _data LIKE "B"
but, I couldn't find how to set the query option GROUP BY _id.
Please help me.