如何在Cassandra 3.11中使用 group by 子句?我点击了此链接-Group by in CQL for Cassandra DB not working
尽管答案是可以接受的,但是当我创建相同的表并运行查询时,它显示了不同的结果(与预期不符)
我遵循的步骤是-
create table hashtags(
id uuid,
texts text,
frequence int,
primary key ((texts), frequence, id))
with clustering order by (frequence desc, id asc);
然后插入一些虚拟数据-
select texts, sum(frequence) from hashtags group by texts;
,输出为-
预期输出-
text | system.sum(frequence)
-------+-----------------------
hello | 10
hi | 7