ich bereit, die folgende Tabelle „keyspaceB.memobox“Bei Cassandra, ich weiß nicht, wie zu tun, BY
DROP TABLE IF EXISTS keyspaceB.memobox;
CREATE TABLE IF NOT EXISTS keyspaceB.memobox (
pkey1 text,
pkey2 text,
id timeuuid,
name text,
memo text,
date timestamp,
PRIMARY KEY ((pkey1, pkey2),id,name)
) WITH CLUSTERING ORDER BY (id DESC,name DESC);
Und ich folgende Daten registriert.
INSERT INTO memobox (pkey1,pkey2,id,name,memo,date) VALUES ('a','b',now(),'tanaka','greet message1','2016-12-13');
INSERT INTO memobox (pkey1,pkey2,id,name,memo,date) VALUES ('a','b',now(),'yamamoto','greet message2','2016-12-13');
wird die folgende
SELECT * FROM memobox where pkey1='a' and pkey2='b' ORDER BY id;
jedoch Erfolg haben, wird die folgende scheitern. Ich möchte Ihren Professor fragen, was falsch ist.
SELECT * FROM memobox where pkey1='a' and pkey2='b' ORDER BY name;
■ Fehler
cqlsh:keyspaceb> SELECT * FROM memobox where pkey1='a' and pkey2='b' ORDER BY name;
InvalidRequest: code=2200 [Invalid query] message="Order by currently only support the ordering of columns following their declared order in the PRIMARY KEY"
cqlsh:keyspaceb>
Danke für Ihre ausführliche Antwort !! Ich schätze. Es war sehr hilfreich. –