日期:2014-05-20 浏览次数:20933 次
SELECT CASE WHEN SITEID=0 OR SITEID=100 THEN 0 ELSE SiteID END AS Siteid,COUNT(1) FROM View_eBayOL_RepeatCount GROUP BY CASE WHEN SITEID=0 OR SITEID=100 THEN 0 ELSE SiteID END
var query = (from p in eBayOLProductQuery
join site in db.Site on p.SiteID equals site.SiteId
group p by new { ebaySiteID = (p.SiteID == 100 ? 0 : p.SiteID) } into g
select new { ID = g.Key, TotalCount = g.Count() }).ToList();