如何在示例中更改 SQL 查询
本文关键字:SQL 查询 | 更新日期: 2023-09-27 17:55:58
我已经尝试过,但无法将此t-sql转换为linq。
select title , count(number) as order_number from order
group by title
它将是这样的:
var result = context.order
.GroupBy(p=>p.title)
.Select(p=> new {title = p.Key, order_number = p.Count()})