How to use a list variable in SOQL?

How to use a list variable in SOQL?

Sample Code:

    public List<String> ids = new List<String>{‘003A0560014LLW9′,’a03A0000014LLWi’,’s03A000er14LLWq’,’a03A034d014LLWi’,’a03un000014LLWi’,’a03A0y00014LLW9′,’0019000000GuZEF’};
    

    public List<Account> acc {get;set;}
   
    public void find()
    {       
        acc = Database.Query(‘Select Name, SLA__c From Account Where Id IN: ids’);       
    }

Leave a Reply