日期:2014-05-20 浏览次数:20915 次
var query= from x in ( from a in ItemVerifyHistory where ItemVerifyHistory.Where(b=>b.Sequence==1 && a.Sequence>1 && b.VerifyAddress==8 && (a. VerifyAddress != b.VerifyAddress || System.Data.Linq.SqlClient.SqlMethods.DateDiffDay(b. VerifyDate,a. VerifyDate)>=1)).Any() group a by a.ItemID into g select new {falsenum=g.Count(),g.Key}) join b in ProductItem on x.ItemID equals b.ItemID select new {b.ProductID,x.falsenum};