将此查询表达式转换为 LINQ 表达式时我真的很痛苦。
SELECT
r.Disc_code
,r.SEX
FROM RACE r
WHERE r.EVENT_CODE = 100
GROUP BY
r.SEX
, r.disc_Code
order by r.disc_code
我可以使用一个表,但我没有在 stackoverflow 或 MSDN 中看到任何链接两个组表达式的示例。我错过了什么吗?
最佳答案
也许是这样的:
var results = from r in dataContext.Race
where r.EVENT_CODE == 100
orderby r.Disc_Code ascending
group r by new { r.Sex, r.Disc_Code } into g
select g.Key;
关于linq - 将组 SQL 表达式转换为 LINQ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/883918/