Search code examples
selectcassandrawhere-clausecql

Alternative for OR condition after where clause in select statement Cassandra


Is it possible in Cassandra to use multiple conditions union ed together after the where clause in a select statement like in any of the RDBMS. Here is my code :

SELECT * from TABLE_NAME WHERE COND1= 'something' OR COND2 = 'something';  

Solution

  • Simple answer: there is no equivalent of OR

    http://www.datastax.com/docs/0.8/dml/using_cql

    Here is the command reference for v0.8:

    http://www.datastax.com/docs/0.8/references/cql#cql-reference

    SELECT [FIRST N] [REVERSED] FROM [USING ] [WHERE ] [LIMIT N];

    ..

    The WHERE clause provides for filtering the rows that appear in results. The clause can filter on a key name, or range of keys, and in the case of indexed columns, on column values. Key filters are specified using the KEY keyword, a relational operator, (one of =, >, >=, <, and <=), and a term value. When terms appear on both sides of a relational operator it is assumed the filter applies to an indexed column. With column index filters, the term on the left of the operator is the name, the term on the right is the value to filter on.