Linq Sql

 

 

2.Group By

var query= from order in queryOrderList
group order by order.ProxyID
into g
where g.Sum(u => u.Num) >= 5
select g.Key
;

等价于

select t2.ProxyID from (
select sum(Num) num,t.ProxyID from OrderTBs t GROUP BY t.ProxyID
) t2
where t2.num>5

 

3.Group By having

待补充

 

4.Sum

decimal? sum = _member.DbSet .Where(q => q.MemberID == 11) .Sum(q => (decimal?)q.ActiveAmount);  

 

posted @ 2017-07-12 13:40  连先森  阅读(87)  评论(0编辑  收藏  举报