0

我对 linq 相当陌生,并且在将以下 sql 转换为 linq 时遇到问题:

select 
    c3.COURSE, c3.DESCR
from 
    (select c.courseprefix, MAX(c.coursesuffix) [coursesuffix]
    from 
        (select distinct SUBSTRING(course,1,3)[courseprefix], RIGHT(course, LEN(course) - 3) [coursesuffix]
        from PsCourses where LEN(course) >= 3 ) c
    group by c.courseprefix 
    ) c2 inner join PsCourses c3 on (c2.courseprefix + c2.coursesuffix) = c3.COURSE
where
    c3.COURSE_STATUS = 'A'
order by
    c3.course
4

1 回答 1

2

好吧,你可以使用http://www.sqltolinq.com/downloads 或者你可以做一个 IQueryable,但在我个人的标准中,我更喜欢用原生 sql 编写复杂的查询

于 2013-04-10T22:28:02.730 回答