I'm new to SOQL and apex world and I'm writing a dynamic SOQL query where I need to retrieve all the records that's firstname starts with eighter 'a' or 'A'. Using OR operator is not working.
Example -
Firststname__c Lastname__c
Adam Johnson
Amelia Johnson
Johnson Johnson
So, when I run the query it should return top two rows.
(Although I'm writing dynamic queries, I'm trying to run the query in the query editor first to make sure everything works as expected) Following are the queries I have tried: 1.
SELECT First_Name__c, Email__c, Last_Name__c FROM Student__c WHERE (Email__c LIKE 'A%' OR Email__c Like 'a%')
And it returns nothing.
2.
SELECT First_Name__c, Email__c, Last_Name__c FROM Student__c WHERE Email__c LIKE '[a-A]%'
Return nothing
3.
SELECT First_Name__c, Email__c, Last_Name__c FROM Student__c WHERE Email__c LIKE '[a-A]%' OR Email__c Like 'a%' OR Email__c Like 'a%'
It return records that's Email__c starts with 'a'.