Linq与计数组
我如何在linq(vb.net)中写这个查询?
select B.Name from Company B group by B.Name having COUNT(1) > 1
喜欢这个:
from c in db.Company group c by c.Name into grp where grp.Count() > 1 select grp.Key
或者,使用方法语法:
Company .GroupBy(c => c.Name) .Where(grp => grp.Count() > 1) .Select(grp => grp.Key);
对于任何人想在VB中做这个(因为我是,什么都找不到)
From c In db.Company Select c.Name Group By Name Into Group Where Group.Count > 1