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
zeezackzeezack 

Multple where queries in one query?!

I am trying to create a piece of script, which will allow me to pull out a series of claims from a list..

 

so say I have my list

 

item1

item2

item3

item4

 

instead of writing a call for each one

 

Select field1, field 2 from table WHERE field1='item1'

Select field1, field 2 from table WHERE field1='item2' 

Select field1, field 2 from table WHERE field1='item3' 

Select field1, field 2 from table WHERE field1='item4' 

 

 

zeezackzeezack

I've read something about their being an IN clause to solve this?

 

SELECT Column1, Column2, Column3 FROM Table1 WHERE Column1 IN (Valu1, Value2)
 

apexsutherlandapexsutherland

Hi zeezack,

 

Yes, you can specify multiple values in your query criteria by using "IN(value1, value2,...)". See the API reference doc here:

 

http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_soql_select.htm#conditionExpression