【发布时间】:2017-04-15 20:54:24
【问题描述】:
我创建了表格
CREATE TABLE testtab (
testtabmainid bigint,
testtabid timeuuid,
posteddate timestamp,
description text,
year bigint,
month bigint,
day bigint,
PRIMARY KEY ((year,month,day),posteddate,testtabmainid)
) WITH CLUSTERING ORDER BY (posteddate DESC,testtabmainid desc);
然后上
SELECT testtabmainid,posteddate,year,month, day FROM testtab;
我得到了这样的结果
testtabmainid / 发布日期 / 年份 / 月 / 日
90 / 2016-12-01 11:19:11+0530 / 2016 / 11 / 30
89 / 2016-11-30 16:21:58+0530 / 2016 / 11 / 30
88 / 2016-11-30 16:13:33+0530 / 2016 / 11 / 30
91 / 2016-12-01 11:20:42+0530 / 2016 / 12 / 1
最后一行没有排序。我需要顶部的最后一行(testtabmainid =91)
我需要以 desc 方式对 testtabmainid 中的表进行排序
【问题讨论】:
标签: sorting cassandra datastax cql