+ Start a Discussion
Pavushetti AbhilashPavushetti Abhilash 

Retrieved records by soql should save in a new list.

Soql query to get 100 records from account.
List<account> acctList = [select id, name from account limit 100]. The retrieved 100 records should save in NEW LIST. How could i accomplish.
Danish HodaDanish Hoda
List<account> newAcctList = new List<account>();
Hii Pavushetti Abhilash
Try Below Code
list<Account> list1 = new list<Account>();
list<Account> list2 = [select id,Name from Account];

Please Mark It As Best Answer If It Helps
Thank You!