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

Query for getting fields from Account and contact
Hi All,
i wrote query like " SELECT FirstName,LastName FROM Contact WHERE Account.id IN (SELECT Name, Phone FROM Account)". but not working.
Could you pls write simple query for getting frelds from account and contact using inner query.
Thank you..
i wrote query like " SELECT FirstName,LastName FROM Contact WHERE Account.id IN (SELECT Name, Phone FROM Account)". but not working.
Could you pls write simple query for getting frelds from account and contact using inner query.
Thank you..
The above query getting error like this:
FirstName,LastName FROM Contact WHERE Account.id IN (SELECT Id FROM Account)
^
ERROR at Row:1:Column:46
The left operand 'Account.id' cannot have more than one level of relationships
could you pls solve this.. Thank you
select id,firstname,lastname from contact where accountid in(select id from account) limit 10
check this
if it works mark it as best answer
it's working. Could you pls explain, why you should take id field as accountid. Actually it is Account.Id right.
the following both queries are working. Could u pls explain? when should i use dot(.) operator?
SELECT account.id FROM Contact And SELECT accountid FROM Contact