I have a M:n relationship between 2 entities (Company and Address) resolved through CompanyAddress. I need a list of companies and the city and state for their "Primary" address if it exists, otherwise, I still need the company info.
In sql, it would look like:
Select *
From Company
Left Outer Join CompanyAddress CA on CA.CompanyID = Company.CompanyID
Inner Join Address on Address.AddressID = CA.AddressID and Address.Type = "PRIMARY"
Where Company.Name Like 'ABC%'
Any ideas how to achieve both the outer join and the Address.Type = "PRIMARY" as a join criteria?
Thanks for your help.
--jw