Left Outer Join SOQL

cloudy_weather

I have the following entities:

<complexType name="Account"> 
 ..
 <element name="Account__r" nillable="true" minOccurs="0" type="tns:QueryResult" /> 
...
...
<complexType name="Address__c">
..
  <element name="Account__c" nillable="true" minOccurs="0" type="tns:ID" /> 
  <element name="Account__r" nillable="true" minOccurs="0" type="ens:Account" />

I need to retrieve all the address of Account, given Address__c I can retrieve the accounts (SELECT Name,Account__r.Name, Account__r.AccountNumber FROM Address__c), but I need to pull all the addresses__c for each account.

So if one Account has not associated to any Address__c entries I want to show it in the results regardless.

How can I do that?

superfell

You can use a SOQL-R child select to fetch the related addresses, e.g.

select id,name,accountNumber, (select id, name from account__r) from account

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related