function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shubham SengarShubham Sengar 

SOQL problem 2

Give me a list of all the opportunities with stage name ‘Prospecting’ with their account name??



select name(select id from Account) from Opportunity where StageName='Prospecting'

but it gives error ..
select name,(select name from Account__r) from Opportunity where
                              ^
ERROR at Row:1:Column:31
Didn't understand relationship 'Account__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
Best Answer chosen by Shubham Sengar
William TranWilliam Tran
Try this:

select name, Account.name from Opportunity where stagename ='Prospecting'