0

Trying to build something for a batch job and am hitting an issue when testing in query editor in dev console.

I know you can do something like:

String[] stagenames= new string[]{'1%','2%'};
List<opportunity> o = [select id, stagename from opportunity where stagename like :stagenames];

So I'm trying to do something similar in dev console Query Editor

select id, stagename from opportunity where stagename like ('1%','2%')

but its throwing 'Unknown error parsing query'

Is there a syntax issue somewhere that I missed? Or is dynamic soql the only option here and I can't reproduce in Query Editor. Just a bit curious.

1 Answer 1

1

That's a special feature of the Apex language; SOQL does not have an equivalent feature. The possible conditions you can use are in the language reference.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .