Reputation: 2788
How can I produce something like this with Linq? I'm trying to work something out, this is related to my other post, but my distinct keeps coming back with more rows than expected
Add Conditional Join Dynamically with Linq
select distinct c.CompanyID, c.CompanyName from Company c
left join CompanyIndustry ci
on c.companyid = ci.companyid
left join CompanyService cs
on c.CompanyID = cs.CompanyID
where cs.ServiceID = 6 and ci.IndustryID = 4
Upvotes: 0
Views: 331
Reputation: 9607
If your companyID has more than one related industry or service, you'll get more than one row per company.
Upvotes: 2