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
Debra Price 25Debra Price 25 

Need to avoid multiple Or clauses in a query if possible. Object Contact

I'm using Dataloader to export data and need to limit the OR's in my query, because I have so many data fields in the where clause. is there a way to use the In clause for two or more fields for example or possibly a query with a sub query in dataloader?
Object = Contact
Where Clause Fields
  • name
  • Email
  • Email2__c
  • Email3__c
  • Email4__c
Basic Query
Select id, name,, MobilePhone, HomePhone, OtherPhone, Email, Email2__c, Email3__c, Email4__c, accountid
from contact
(name = 'Abdulaziz Al-Saleh' and ( email='' or email2__c='')) or
(name = 'Abdullah Al-Rasheed' and ( email='' or email2__c='')) or
(name = '' and ( email='' or email2__c='')) or
(name = 'Amjad Showail' and ( email='' or email2__c=''))

There are many more OR clauses to follow. I would like to avoid all the OR clauses however i need both the name and the temail addresses in  the where clause.
Rakshana Cube84Rakshana Cube84
Hi Debra,

You can use IN in the query to avoid a lot of OR clauses.
Select id, name,, Email from contact where email in ('','','')