1

If i run below query it returns all records of that object:

Select ID, name from Contact where Name like '%%%'

This should return only those records which have % in the name. For example if i run below query it will return only those records which have test in the name.

Select ID, name from Contact where Name like '%test%'

Any idea, What is going on here?

1 Answer 1

3

You would have to escape the percent sign like:

Select ID, name from Contact where Name like '%\%%'

Otherwise %%% would be treated same as %%


Found this in SOQL documentation, never noticed before but now thanks to your question:

enter image description here

1
  • Hmm, right, I missed that. Thanks.
    – Mr.Frodo
    Commented May 22, 2019 at 11:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .