Convert this SQL statement to LINQ-to-SQL
- by goforebroke
I have struggled converting this SQL statement to LINQ to SQL VB.Net 9.0. I have used Linqer but no success. Any help would be appreciated
select t.TeeId,
t.DescriptionId,
t.[Description],
t.Rating,
t.Slope,
case when d.TotalHoles <> h.TotalHoles then 0
else 1 end [Status]
from dbo.CourseDescription d
inner join dbo.CourseTees t
on t.DescriptionId = d.DescriptionId
inner join (select TeeId, count(*) as TotalHoles
from dbo.CourseHoles
group by TeeId) h
on h.TeeId = t.TeeId
where d.CourseId = 1