You need to sign in to do that
Don't have an account?

How to query the Account table and include Lead table fields
In another post, I saw how to query from the Lead table to the Account table like the following:
select firstname, convertedaccount.lastname from lead where firstname = 'John'
the firstname field is from the Lead table and the lastname field is the Account table.
How can I do the reverse where I want to go from the Account table (knowing the Account.lastname = 'Smith') and pull the firstname field from the Lead table and the lastname field from the Account table. I don't want to do this with two queries but like above, only use one query.
select firstname, convertedaccount.lastname from lead where firstname = 'John'
the firstname field is from the Lead table and the lastname field is the Account table.
How can I do the reverse where I want to go from the Account table (knowing the Account.lastname = 'Smith') and pull the firstname field from the Lead table and the lastname field from the Account table. I don't want to do this with two queries but like above, only use one query.
As fas as I know, the only way to accomplish this by using the inner query. However, we are not able to locate the correct relationship name between Account(Parent) and Lead(child). Following I tried to run from dev console, but it is not working. The relationship name between Account and Lead is ConvertedAccount:
select Id, (select Id from ConvertedAccount) from Account