Reading Data From Cassandra Table

Reading Data From Cassandra Table

Instructor-svg Al-Mamun Sarkar
Sep 20 , 2020

The SELECT command is used to read data and the WHERE command is used to adding a condition on the SELECT statement.

 

Select all data from a table: 

Syntax:

SELECT * FROM table_name;

Example:

SELECT * FROM employees;

 

Select selected column data from a table: 

Syntax:

SELECT column1, column2, .... 
FROM table_name;

Example:

SELECT city, name
FROM employees;

 

Adding Condition on the SELECT statement: 

Syntax:

SELECT column1, column2, .... 
FROM table_name
WHERE condition;

Example:

SELECT city, name
FROM employees
WHERE id = 2;

 

Allow Filtering:

SELECT * FROM employees WHERE id > 2 ALLOW FILTERING;

Using ALLOW FILTERING is very bad for performance. So we should try to avoid using ALLOW FILTERING. 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram