+ Start a Discussion
penchala rajupenchala raju 

can i fetch two contacts and opportunites records of particular Account object using SOQL

pconpcon
Yes, you can do this via a sub query using the relationship name
 
select Id
    (
        select Name
        from Contacts
    ),
    (
        selet Name
        from Opportunities
    )
from Account
where Id = 'xxxxxx'

 
rajesh gandirajesh gandi
in Soql we are using sub query up to 5 times