我在cassandra 数据库中订购数据时遇到问题。这是我的表结构:
CREATE TABLE posts (
id uuid,
created_at timestamp,
comment_enabled boolean,
content text,
enabled boolean,
meta map<text, text>,
post_type tinyint,
summary text,
title text,
updated_at timestamp,
url text,
user_id uuid,
PRIMARY KEY (id, created_at)
) WITH CLUSTERING ORDER BY (created_at DESC)
当我运行此查询,我得到了以下信息:
查询:
select * from posts order by created_at desc;
讯息:
ORDER BY is only supported when the partition key is restricted by an EQ or an IN.
或者此查询返回数据而不进行排序:
select * from posts
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句