标签:ar strong on new as sql 简单 rom ip
说明:返回集合中元素的最小值;不延迟。生成SQL语句为:SELECT MIN(…) FROM
查找任意产品的最低单价:
var q = db.Products.Select(p => p.UnitPrice).Min();
查找任意订单的最低运费:
var q = db.Orders.Min(o => o.Freight);
查找每个类别中单价最低的产品:
var categories = from p in db.Products group p by p.CategoryID into g select new { CategoryID = g.Key, CheapestProducts = from p2 in g where p2.UnitPrice == g.Min(p3 => p3.UnitPrice) select p2 };
标签:ar strong on new as sql 简单 rom ip
原文地址:http://www.cnblogs.com/su-king/p/4045575.html