How to use Query inside Query in SOQL?

Sample SOQL:

List<Account> listAccount = [SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Opportunity)];

system.debug('Output is ' + listAccount);

Cheers!!!

No comments:

Post a Comment