我测试了 sql,它在 Sqlite Spy 中运行良好:
select ifnull(_name, _number) as identifer, count(_id) as amount from call group by identifer
我想在 ContentConsolver 中使用它,但它不能与“group by”一起使用:
String[] projections = new String[] { "ifnull(name, number) as identifer", "count(_id) as amount" };
String group = "identifer";
//String selection = ") GROUP BY (" + group;
Cursor cursor = getContentResolver().query(CallLog.Calls.CONTENT_URI, projections, null, null, null /*!group*/ );
我该怎么办?