我的用例
我想通过时间戳DESC订购结果.但我不希望时间戳成为主键中的第二列,因为这将取决于我的查询功能
例如
create table demo(oid int,cid int,ts timeuuid,PRIMARY KEY (oid,cid,ts)) WITH CLUSTERING ORDER BY (ts DESC);
需要查询:
I want the result for all the below queries to be in DESC order of timestamp select * from demo where oid = 100; select * from demo where oid = 100 and cid = 10; select * from demo where oid = 100 and cid = 100 and ts > minTimeuuid('something');
我正在尝试使用CLUSTERING ORDER IN CQL创建此表并获取此错误
cqlsh:v> create table demo(oid int,cid int,ts timeuuid,PRIMARY KEY (oid,cid,ts)) WITH CLUSTERING ORDER BY (ts desc); Bad Request: Missing CLUSTERING ORDER for column cid
在本文档中,它提到我们可以使用多个键来进行集群排序.谁知道怎么做?
去这里Datastax doc