0

I have a custom string field, that is explicitly marked as Case Sensitive. When I query for this field, like so:

SELECT field__c 
FROM Object__c 
WHERE field__c LIKE 'a%' 
  OR field__c LIKE 'A%'

I only get results that start with capital A. If I remove either of the conditions, it works fine.

Is this expected behavior, is there a way I can make my query return results starting with both lower case a and upper case A?

1 Answer 1

0

This is not an ideal answer, but after fiddling for a long time with this query I found a way to make it work. Basically, by adding a second wildcard (granted you know there will be at least 2 characters in your field).

For instance, the following query works as expected:

SELECT field__c 
FROM Object__c 
WHERE field__c LIKE 'a_%' 
  OR field__c LIKE 'A_%'

My best guess is that there is some query planner behind the scenes, that limits the first query. Because the second query is more restricted, it probably allows it to run. This is just a theory though, I found no way to debug why the first query fails

You must log in to answer this question.

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