I want to sort Accounts using the field in Opportunity in my SOQL.
This is the query which selects Accounts and Opportunities. I want to order the Accounts using MAX of Opportunity.ExpectedRevenue field.
Select Id, Name (Select Id, ExpectedRevenue from Opportunities) from Account where Id in :listVar and ownerId = :currentUser
Is it even possible?