LIKE operator in SOQL against set of strings

Set <String> accNames = new Set <String> {'Test%', 'Sample%'};
List <Account> accList  = [SELECT Id FROM Account WHERE Name LIKE : accNames];

Leave a Reply