查询内容解析器获取两天之间的所有日志

时间:2016-02-05 16:12:46

标签: android android-contentresolver

我想创建一个ContentResolver的查询,该查询将在指定时间之间返回所有通话记录(namenumberphoto),但它需要按计数数排序。 MySQL查询看起来像:

SELECT count(*) as counts, CallLog.Calls.CACHED_NAME,
  CallLog.Calls.NUMBER, CallLog.Calls.CACHED_PHOTO_ID
FROM calls
WHERE CallLog.Calls.DATE > '2016-02-02' AND CallLog.Calls.DATE < '2016-02-04'
GROUP BY CallLog.Calls.CACHED_NAME order by counts DESC;

这就是我查询的方式,但我还需要group byorder

Cursor cur = .getContentResolver()
  .query(callUri, null, CallLog.Calls.DATE + " BETWEEN ? AND ?", whereValue, null);

您能否帮我添加group by名称和order by每件商品的数量?

0 个答案:

没有答案