How to Multiple Values With Like Operator using SOQL in Salesforce?

Sample Code:

Set<String> accountNameMatches = new Set<String> { 'A%', 'B%', '%C%', '%D' };

List<Account> accList = [SELECT Id FROM Account WHERE Name LIKE :accountNameMatches];

system.debug('accList-' + accList);


Follow Us

Posted By : Sudeer Kamat Date :

view_module Related

  • How To Get Picklist Values Using SOQL In Salesforce?How To Get Picklist Values Using SOQL In Salesforce?
  • How to Find Users Last Login Date and Time In SalesforceHow to Find Users Last Login Date and Time In Salesforce
  • How To Quickly Find Newly Created Fields In SalesforceHow To Quickly Find Newly Created Fields In Salesforce
  • SOQL Query to Select All Records Even From Recycle Bin in Salesforce?SOQL Query to Select All Records Even From Recycle Bin in Salesforce?
  • How to Get the List of Apex Classes from a Salesforce Org?How to Get the List of Apex Classes from a Salesforce Org?

label Labels

Comments 0