user2090879
user2090879

Reputation: 693

CQL Cassandra OR operator

I'm trying to do something like this in CQL:

SELECT address FROM Person WHERE age= 20 or age= 25  

But Cassandra doesn't support the OR operator and I can't use IN(20, 25) either, because age isn't a primary key. Is there any way to solve this ?

Thanks in advance.

Upvotes: 11

Views: 8047

Answers (2)

Cullen Fluffy Jennings
Cullen Fluffy Jennings

Reputation: 965

You can do this with

SELECT address FROM Person WHERE age IN ( 20, 25 )

Upvotes: 9

jbellis
jbellis

Reputation: 19377

You will have to perform the disjunction client-side, or use an analytical tool like Hive or Pig.

Upvotes: 6

Related Questions