Is it possible to use nested ANDs and ORs inside a query?

Is it possible to use nested ANDs and ORs inside a query?

In the most simple words, I would like to do a query like this
(“A” or “a”) and (“B” or “b”)

I found this topic Combining AND and OR in a query but there is no answer for it.

I will appreciate a lot any help!

Does this not work?

{{query (AND (OR “A” “a”) (OR “B” “b”))}}