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
NullPointerExceptionNullPointerException 

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

@anilbathula@@anilbathula@
Hi

go through this link :-
http://www.salesforcegeneral.com/introduction-to-soql/
gud explanation about using wild cards
NullPointerExceptionNullPointerException

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".

Deepak Kumar ShyoranDeepak Kumar Shyoran

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

 

  

Ryan DRyan D

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.