Linq-to-SQL 分组排序不正确
您好,有人可以帮我将此 tsql 语句转换为 c# linq2sql 吗?
select [series] from table group by [series] order by max([date]) desc
这就是我到目前为止所拥有的 - 列表的顺序不正确..
var x = from c in db.Table
orderby c.Date descending
group c by c.Series into d
select d.Key;
Hi can someone help me convert this tsql statement into c# linq2sql?
select [series] from table group by [series] order by max([date]) desc
This is what i have so far - the list is not in correct order..
var x = from c in db.Table
orderby c.Date descending
group c by c.Series into d
select d.Key;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 LINQ
orderby
子句与 SQL 子句执行的操作不同。在这里,这应该修复它:Your LINQ
orderby
clause isn't doing the same thing as your SQL one. Here, this should fix it: