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
wt35wt35 

SOQL question: Can I use the AND operator?

Hello

 

I need to get a list of cases where two conditions are met, hence my question, can I use the AND operator in a SOQL, such as here:

 

List<Case> c = new List<Case> ();
        c = [SELECT Id,CaseNumber,OwnerId FROM Case WHERE AccountId = :a.Id AND IsClosed = FALSE];

 

Thank you

Marc

 

Best Answer chosen by Admin (Salesforce Developers) 
zachelrathzachelrath

Yes, you can use AND, OR, etc. in SOQL queries. Your query should work fine.