I want to select the top five opportunities. To determine top five I multiple Opportunity.Amount by Opportunity.Probability for every Opportunity and then pick out the top results.
I was hoping to do:
SELECT AccountId, Amount, Probability, (Amount * Probability) weightedProbability FROM Opportunity order by weightedProbability limit 5
which fails because it does not like:
(Amount * Probability) weightedProbability