标签:run nbsp int smo sum sql last nis select
1.日期比较
var query = from order in dbContext.OrderTBs
where subProxyIDs.Contains(order.ProxyID)
&& firstDayOfPreviousMonth <= EntityFunctions.TruncateTime(order.FinishTime)
&& lastDayOfPrdviousMonth >= EntityFunctions.TruncateTime(order.FinishTime)
&& order.Status==(int)OrderStatus.Finished
select order
;
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
待补充
标签:run nbsp int smo sum sql last nis select
原文地址:http://www.cnblogs.com/liandy0906/p/7155023.html