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

SOQL question: Can I use the AND operator?



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



Best Answer chosen by Admin (Salesforce Developers) 

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