# Error parsing query or unsupported statement?

**URL:** <https://forum.scylladb.com/t/error-parsing-query-or-unsupported-statement/5299>\
**Category:** Database Community\
**Tags:** data-model, cql\
**Created:** [March 3, 2026, 8:32pm UTC](https://forum.scylladb.com/t/error-parsing-query-or-unsupported-statement/5299 "2026-03-03T20:32:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Douglas\_A\_Domingues](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/douglas_a_domingues/32/1945_2.png) [@Douglas\_A\_Domingues](https://forum.scylladb.com/u/Douglas_A_Domingues)\
**Post date:** [March 3, 2026, 8:32pm UTC](https://forum.scylladb.com/t/error-parsing-query-or-unsupported-statement/5299/1 "2026-03-03T20:32:56Z")

</div>

Hi everyone, i’m in the community. I’ve been starting to use scylladb lately and i just noticed that i cant use “brackets” in where clause, at least not to encapsulate blocks, this prevents me from using ‘or’ properly, and yes, im not using allow filtering, anyway, what i noticed is that i cant do this:

select \* from users

where (country = ‘BR’ and state = ‘SP’) or (country = ‘BR’ and state = ‘RJ’)

when i try to do this i get an error saying that i’m missing ‘)’

even though i’m not, and weird as it sounds, looking at the docs, it seems to me that i was supposed to be able to do this

---

<div class="post-metadata">

**Author:** ![Piotr\_Smaron](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/piotr_smaron/32/586_2.png) [@Piotr\_Smaron](https://forum.scylladb.com/u/Piotr_Smaron)\
**Post date:** [March 18, 2026, 8:46am UTC](https://forum.scylladb.com/t/error-parsing-query-or-unsupported-statement/5299/2 "2026-03-18T08:46:14Z")

</div>

Yeap, today this is not actually supported, and the docs can definitely give the opposite impression. Two things:

1. In Scylla’s parser, WHERE is defined as a sequence of relations joined only by AND, we don’t accept OR.
2. Parentheses are only allowed around a single relation, so this works: (a = 1) AND (b = 2), but this does not: (a = 1 AND b = 2), and that is why you get the misleading “missing )” error: once the parser sees (, it expects exactly one relation inside, not a nested boolean expression with AND/OR.

Your example is therefore currently unsupported, but you can still try rewriting it. Otherwise: run two separate queries and merge results client-side.

BTW. I’ll fix the docs.

---

<div class="post-metadata">

**Author:** ![Piotr\_Smaron](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/piotr_smaron/32/586_2.png) [@Piotr\_Smaron](https://forum.scylladb.com/u/Piotr_Smaron)\
**Post date:** [March 18, 2026, 8:57am UTC](https://forum.scylladb.com/t/error-parsing-query-or-unsupported-statement/5299/3 "2026-03-18T08:57:07Z")

</div>

(Can’t edit my post any longer, so writing a follow-up comment).

With regards to rewriting the query, for your specific example, you can try factoring out the common part:  
`SELECT * FROM users`  
`WHERE country = ‘BR’`  
`AND state IN (‘SP’, ‘RJ’);`

---

<div class="post-metadata">

**Author:** ![Piotr\_Smaron](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/piotr_smaron/32/586_2.png) [@Piotr\_Smaron](https://forum.scylladb.com/u/Piotr_Smaron)\
**Post date:** [March 20, 2026, 11:31am UTC](https://forum.scylladb.com/t/error-parsing-query-or-unsupported-statement/5299/4 "2026-03-20T11:31:56Z")

</div>

The docs have been fixed here: [docs/cql: clarify WHERE clause boolean limitations by ptrsmrn · Pull Request #29100 · scylladb/scylladb · GitHub](https://github.com/scylladb/scylladb/pull/29100), and will be officially updated in 2 weeks time with 2026.2 release.
