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
ColoradoMikeColoradoMike 

Suggestion about SELECT statement with LIKE?

Hello,

I'm trying to do a SOQL SELECT statement where I search for a number of contacts whose Accounts contain one of several search terms.  Say I want contacts from Accounts that contain "Apple" and "Pear".

What I would like to do is this, but it doesn't work:
SELECT Firstname, Lastname from Contact WHERE Contact.Account.Name LIKE '%Apple%' , '%Pear%'

I suppose I could do this (which works, but is a lot longer):
SELECT Firstname, Lastname from Contact WHERE (Contact.Account.Name LIKE '%Apple%' ) OR (C ontact.Account.Name LIKE '%Pear%').

Does anyone have any better way to use LIKE with multiple search parameters?
Thanks!