[giant sequoia database Sequoiadb] whether SequoiaDB supports the parameters of the sum function in group by.
[detailed description of the problem]
In SequoiaDB, when group by, can fields of decimal (High Precision number) type do sum functions?
[solution]
The 1.decimal type supports aggregate functions in group by, such as:
The following data is available in the collection cl:
{"a": {"$decimal": "111.111"}, "name": "zhangsan"}
{"a": {"$decimal": "222.222"}, "name": "zhangsan"}
{"a": {"$decimal": "123.456"}, "name": "lisi"}
two。 Aggregate the'a 'field of type decimal when using group by
Db.exec ("select sum (a) as sum from cs.cl group by name")
3. The results are as follows:
{"decimal": {"$sum": "123.456"}}
{"decimal": {"$sum": "333.333"}}
[reference for details]
High precision number: http://doc.sequoiadb.com/cn/SequoiaDB-cat_id-1519612297-edition_id-300
Aggregate function: http://doc.sequoiadb.com/cn/index-cat_id-1432190972-edition_id-300
[solution]
The decimal type supports aggregate functions in group by, such as:
1. The following data is available in the collection cl:
{"a": {"$decimal": "111.111"}, "name": "zhangsan"}
{"a": {"$decimal": "222.222"}, "name": "zhangsan"}
{"a": {"$decimal": "123.456"}, "name": "lisi"}
two。 Aggregate the'a 'field of type decimal when using group by
Db.exec ("select sum (a) as sum from cs.cl group by name")
3. The results are as follows:
{"decimal": {"$sum": "123.456"}}
{"decimal": {"$sum": "333.333"}}
[reference for details]
High precision number: http://doc.sequoiadb.com/cn/SequoiaDB-cat_id-1519612297-edition_id-300
Aggregate function: http://doc.sequoiadb.com/cn/index-cat_id-1432190972-edition_id-300