table-numbers

INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 1, 1, 1, 1);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 1, 1, 1, 2);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 1, 1, 1, 3);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 1, 1, 2, 1);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 1, 1, 2, 2);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 1, 1, 2, 3);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 1, 2, 2, 1);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 1, 2, 2, 2);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 1, 2, 2, 3);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 2, 1, 1, 1);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 2, 1, 1, 2);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 2, 1, 1, 3);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 2, 1, 2, 1);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 2, 1, 2, 2);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 2, 1, 2, 3);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 2, 2, 2, 1);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 2, 2, 2, 2);
INSERT INTO cycling.numbers (key, col_1, col_2, col_3, col_4) VALUES (100, 2, 2, 2, 3);
SELECT * FROM numbers;
SELECT JSON * FROM numbers;
SELECT * FROM numbers
  WHERE key = 100 AND col_1 = 1 AND col_2 = 1 AND col_3 = 1 AND col_4 <= 2;
SELECT * FROM numbers WHERE key = 100 AND col_4 <= 2;
SELECT * FROM cycling.numbers WHERE key = 100 AND col_1 = 1
  AND (col_2, col_3, col_4) >= (1, 1, 2)  AND (col_3, col_4) < (2, 3);
SELECT * FROM numbers WHERE key = 100 AND col_1 = 1 AND col_2 > 1
SELECT * FROM cycling.numbers WHERE key = 100 AND col_1 = 1 AND col_2 = 1
  AND (col_3, col_4) >= (1, 2) AND (col_3, col_4) < (2, 3);
SELECT * FROM cycling.numbers
  WHERE key = 100 AND (col_1, col_2, col_3, col_4) <= (2, 2, 2, 1);
SELECT * FROM cycling.numbers
  WHERE key = 100 AND (col_1, col_2, col_3, col_4) <= (2, 1, 1, 4);
CREATE TABLE cycling.numbers (
   key int,
   col_1 int,
   col_2 int,
   col_3 int,
   col_4 int,
   PRIMARY KEY ((key), col_1, col_2, col_3, col_4)
);
DESCRIBE TABLE cycling.numbers;

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com