【发布时间】:2018-10-10 01:37:49
【问题描述】:
下午好,
我目前正在开始使用 Cassandra 和 CQL,但遇到了问题。 我做了一个非常简单的数据库,我想在列之间做一些算术运算(加法,乘法......)。当我尝试这样做时,我收到以下错误:
"no viable alternative at input '-' "
据我所知,Cassandra 长期不支持算术运算,但 official documentation 似乎另有说法。
所以我的问题是:我做错了吗?还是这些运算符仍然不受支持?
我正在使用 Cassandra 3.11.2 和 cqlsh 5.0.1。我的查询是
Select ProductName, NetIncome, ProductionCost, (NetIncome - ProductionCost) from globalsales.Rentability group by ProductName;
其中 NetIncome 和 ProductionCost 都是 int 类型的列。
【问题讨论】:
标签: cassandra cql cassandra-4.0