I have the following query where when I remove the where part it works fine. When I add the WHERE part I get an error on Quotes.Id SELECT Name, StageName, CloseDate , Amount, (SELECT Id FROM Quotes) FROM Opportunity WHERE Quotes.Id='0Q00E0000004PEESA2' ORDER by Name

  • What do you want to achieve from above query? – Ashwani May 10 '17 at 11:24

You can't filter a child value like that directly, but you can use a subquery:

WHERE Id IN (SELECT OpportunityId FROM Quote WHERE Id = '0Q00E0000004PEESA2')
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.