Activity Forums Salesforce® Discussions Write a query: I have 1 parent(account) and 1 child(contact),how will you get F.name,L.name from child and email from the account when Organization name in acc

  • Write a query: I have 1 parent(account) and 1 child(contact),how will you get F.name,L.name from child and email from the account when Organization name in acc

    Posted by Manpreet on April 7, 2017 at 2:08 pm

    Write a query: I have 1 parent(account) and 1 child(contact),how will you get F.name,L.name from child and email from the account when Organization name in account is "CTS"?

    Suraj replied 7 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Suraj

    Member
    April 11, 2017 at 1:34 pm

    Hi Manpreet,

    You can use this query

    select name, (select firstname,lastname from contacts) from Account where name='CTS'

    You can change the fields to the Required Fields according to your need

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos