[SalesForce] Perform a SOQL Query LIKE Specifically for Lowercase

Is there anyway to perform a case sensitive SOQL Query? I have a field name "Policy Number" and I need to say something like:

SELECT Id, Policy Number FROM Case WHERE Policy Number LIKE 'abc%'

But the where statement needs to be case sensitive and look specifically for lowercase…

Thoughts?

Best Answer

The LIKE operator performs a case-insensitive match, unlike the case-sensitive matching in SQL. So if you want to get results according to the case sensitivity then you first have to fetch the records with LIKE operator in list and than addition check over the list to get case sensitive records.

Here is more info.