Reputation: 3
I am querying the data from "countries
" table with or where
clause but it is giving me the below error.
line 1:49 mismatched input 'OR' expecting EOF (...countries WHERE alpha2Code = 'PAK' [OR]...)
Here is my query.
SELECT * FROM countries WHERE alpha2Code = 'PAK' OR alpha3Code = 'PAK' allow filtering;
How can i achieve the task to get data with OR WHERE
clause?
Upvotes: 0
Views: 422
Reputation: 300
Cassandra doesn't support OR and you will need to implement the logic in the code by making multiple codes to achieve what you are trying above
Be warned about the use of allow filtering - not a good practice as you are not querying against a column which is filterable by design.
Upvotes: 1
Reputation: 1125
Cassandra doesn't support the OR operator. Use a disjunction in your code.
Upvotes: 0