【发布时间】:2017-04-06 16:29:45
【问题描述】:
我在 aerospike 中有以下设置:
INSERT INTO test.set (PK,DAY_OF_MONTH,YEAR,value) VALUES (1,2,2017,10)
INSERT INTO test.set (PK,DAY_OF_MONTH,YEAR,value) VALUES (2,2,2017,11)
INSERT INTO test.set (PK,DAY_OF_MONTH,YEAR,value) VALUES (3,3,2017,12)
INSERT INTO test.set (PK,DAY_OF_MONTH,YEAR,value) VALUES (4,3,2017,13)
我是 aerospike 的新手,目前我只知道如何在 LUA 中检索单个值,但我想知道如何检索和创建一组值。
例如,我想知道如何在 aql 中返回如下结果:
AGGREGATE test.someFunction() ON test.set
+------+--------------+------+
| YEAR | DAY_OF_MONTH | SUMA |
+------+--------------+------+
| 2017 | 2 | 21 |
| 2017 | 3 | 25 |
+------+--------------+------+
【问题讨论】: