In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
[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
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.