function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DogmaDogma 

SOQL Limitations....Can I do and in statement?

Hi

Just wondering if I can do an in statement e.g 'where accountid in('123',345','345'). If so, what is the syntax. I'm guessing that this is not possible....

 

SuperfellSuperfell
No you have to expand it out to or statements where accountid='123' or accountid='456' etc. Or if all you're filtering on is a list of Ids, then use the retrieve call rather than query, its more efficient, and allows you to pass up the array of Ids to fetch.