【发布时间】:2018-08-11 13:18:47
【问题描述】:
数据集包含具有以下键的记录:userID、period 和 points。
是否可以按period 和 max points 查询一条记录。
示例场景
数据集
[
/* period: 2016-01-01 */
{ userID: 1, period: '2016-01-01', points: 100},
{ userID: 1, period: '2016-01-01', points: 200},
{ userID: 1, period: '2016-01-01', points: 300},
/* period: 2016-01-02 */
{ userID: 1, period: '2016-01-02', points: 50},
{ userID: 1, period: '2016-01-02', points: 70},
{ userID: 1, period: '2016-01-02', points: 10},
/* period: 2016-01-03 */
{ userID: 1, period: '2016-01-03', points: 80},
{ userID: 1, period: '2016-01-03', points: 20},
{ userID: 1, period: '2016-01-03', points: 0},
]
查询结果:
这些是所需的查询结果。 每个时期一条记录和该时期的最高点数
{ userID: 1, period: '2016-01-02', points: 300},
{ userID: 1, period: '2016-01-03', points: 70},
{ userID: 1, period: '2016-01-04', points: 80},
【问题讨论】:
标签: odata