Created
December 12, 2013 13:17
-
-
Save natbusa/7927797 to your computer and use it in GitHub Desktop.
Little cassandra table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE KEYSPACE ks WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 } ; | |
create table ks.tb ( | |
a1 TEXT, | |
b1 TEXT, | |
b2 INT, | |
d INT, | |
v INT, | |
PRIMARY KEY ( a1, b1, b2 ) | |
); | |
INSERT INTO ks.tb (a1,b1,b2,d,v) VALUES ('abc','def',2,1,12); | |
INSERT INTO ks.tb (a1,b1,b2,d,v) VALUES ('abc','def',2,2,13); | |
INSERT INTO ks.tb (a1,b1,b2,d,v) VALUES ('abc','def',3,3,14); | |
INSERT INTO ks.tb (a1,b1,b2,d,v) VALUES ('abc','def',5,4,15); | |
SELECT b2,v,d FROM ks.tb WHERE a1='abc' and b1='def' and b2>2 LIMIT 2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment