You need to sign in to do that
Don't have an account?
clouddev@surashri
Using multiple LIKE in single SOQL
Hi,
I have a query where its checking multiple email domain like @gmail.com , @hotmail.com etc.
The query is like
SELECT company FROM lead WHERE email LIKE '%@gmail.com' OR email LIKE '%@hotmail.com'.
If I have to check more that 100 email domains in one go then it is exceeding 100 SOQL limit and giving "Too many SOQL queries: 101".
Is there any alternative syntax to achieve this task ?
Please reply,
Thanks,
clouddev@surashri
Try Like This:
String[] filters = new String[]{'%@gmail.com','%@hotmail.com'};
List<Lead> leads = [select id, name from Lead where Email like :filters];
Hi,
Will that get over Too many SOQL queries: 101 error. That is my concern.
Thanks,