【发布时间】:2018-02-28 17:04:14
【问题描述】:
有如下表定义:
CREATE TABLE device_by_create_date (
year int,
comm_nr text,
created_at timestamp,
PRIMARY KEY ((year, comm_nr), created_at)
) WITH CLUSTERING ORDER BY (created_at DESC)
Comm_nr 是唯一标识符。
我希望看到按created_at 列排序的数据,但添加数据时并非如此。
示例条目:
表 CQL:
如何发出select * from table; 查询,返回按created_at 行排序的数据?
【问题讨论】:
标签: sorting cassandra cassandra-3.0 compound-key