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
You should use GROUP BY Not distinct