Cassandra READ Data
SELECT command is used to read data from Cassandra table. You can use this command to read a whole table, a single column, a particular cell etc.
Syntax:
Example:
Let's take an example to demonstrate how to read data from Cassandra table. We have a table named "student" with columns (student_id, student_fees student_name)
Read the whole table using SELECT command
Read Particular Columns
This example will read only student_name and student_id from the student table.
Use of WHERE Clause
WHERE clause is used with SELECT command to specify the exact location from where we have to fetch data.
Syntax:
Note: WHERE clause can be used only on the columns that are a part of primary key or have a secondary index on them.
Example:
0 comments:
Post a Comment