You need to sign in to do that
Don't have an account?

SOQL: like wildcards
Hi,
I don't understand about wildcards:
Please can you explain me ( with example of words) which user'srole name return this:
1 Select id from user where UserRole.Name LIKE ' %Dir%'
2 Select id from user where UserRole.Name LIKE ' Dir%'
3 Select id from user where UserRole.Name LIKE ' Dir_%'
Thanks in advance.
King regard
go through this link :-
http://www.salesforcegeneral.com/introduction-to-soql/
gud explanation about using wild cards
Thanks Anil.B, your reply is very useful.
I share my Knowledge:
1 select id, firstname, lastname from lead where lastname like 'Smith%'
Will match all last names starting with Smith.
2 select id, firstname, lastname from lead where lastname like 'Smith_'
Will match all last names starting with Smith up to 1 additional character
3 Like 'appl_%'
matches Appleton, Apple, and Bappl , but not Appl
4 Contact.Account.Name LIKE '%Apple%' , '%Pear%'
Accounts that contain "Apple" and "Pear".
Hi All,
Thanks Ankil this is really a good link and it have lot of think to learn,and is very useful for new comers on salesforce platform and it also solves the problem of enry.Thanks for your link.
Best Regards
Choudhary Deepak Shyoran
You can also exclude terms from your query like this:
and ( not email like '%test.com%')
**note: you have to use the brackets for this to work.