又问了啊?下面的代码没有调试,但编译通过,你可以试下。凡事自己变通下,你会发现,编程很有趣。
IQueryable<t> table = null; var query = from c in table where c.Date >= DateTime.Parse("2012-04-21") && c.Date < DateTime.Parse("2012-05-23") group c by c.Name into g where g.Count() > 0 select new { Name = g.Key, Times = g.Count() };
IQueryable<t> table = null;
var query = from c in table
where c.Date >= DateTime.Parse("2012-04-21") && c.Date < DateTime.Parse("2012-05-23")
group c by c.Name into g
where g.Count() > 0
select new { Name
IQueryable<t> table = null;
var query = from c in table
where c.Date >= DateTime.Parse("2012-04-21") && c.Date < DateTime.Parse("2012-05-23")
group c by c.Name into g
where g.Count() > 0
select new { Name