我想创建一个ContentResolver
的查询,该查询将在指定时间之间返回所有通话记录(name
,number
,photo
),但它需要按计数数排序。
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 by
和order
:
Cursor cur = .getContentResolver()
.query(callUri, null, CallLog.Calls.DATE + " BETWEEN ? AND ?", whereValue, null);
您能否帮我添加group by
名称和order by
每件商品的数量?