You need to sign in to do that
Don't have an account?
Dhilip Dussa
Add two queries in one loop?
Hi,
I have to two loop values in one loop how it is possible?
Ex:
List<Account> accList = [SELECT Id, Name FROM Account LIMIT 10];
List<Account> accList2 = [SELECT Id, Name FROM Account LIMIT 9 OFFSET 1];
for(){
String s = accList.name + accList2.Name;
}
i want to pass in for loop one by one how it will be possible please help me.
Thanks,
Dhilip Dussa
I am unable to guess what you want to achieve with the above code since
List<Account> accList = [SELECT Id, Name FROM Account LIMIT 10]; will return the first 10 records
and this List<Account> accList2 = [SELECT Id, Name FROM Account LIMIT 9 OFFSET 1]; will return the last 9 records of the above query.
If you put any of this in a for loop you might run into null pointer reference exception. Please tell a little bit more about your requirement and then we can help.