How to execute a SOQL query using APEX? January 5, 2012August 9, 2022InfallibleTechie Admin String soql = “SOQL Query”; list_namae = Database.(soql); Example: List<Account> acc {get; set;} String soql = “SELECT Name FROM Account”; acc = Database.query(soql);