Linq to Entities - where 语句中的子查询
这一定很简单,但我已经搜索了两个小时,但找不到答案。如何在 Linq to Entities 中编写此内容:
SELECT Reg4, Reg5, Reg6
FROM dbo.Table1
WHERE Reg1 = 15
AND Reg2 = ( SELECT MAX(Reg2) FROM dbo.Table2 WHERE Reg1 = 15);
是否可以在查询表达式和基于方法的语法中同时执行此操作?
塔克斯
This must be simple, but I've been searching for 2 hours, and can't find an answer. How do I write this in Linq to Entities:
SELECT Reg4, Reg5, Reg6
FROM dbo.Table1
WHERE Reg1 = 15
AND Reg2 = ( SELECT MAX(Reg2) FROM dbo.Table2 WHERE Reg1 = 15);
Is it possible to do it both in query expressions and method based syntaxes?
Tks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有从 Table1 到 Table2 的导航/关联,那就更容易了。但你没有表现出这一点,所以我也不会......
Easier still if you have a navigation/association from Table1 to Table2. But you didn't show that, so neither will I....