【发布时间】:2017-06-06 22:59:41
【问题描述】:
我的数据库中有一个表。
`tblCustomers`
- CustomerId
- CustomerName
现在我需要将所有客户按CustomerName 分组,但至少应该不止一次出现customername。
如果有 10 个客户的 name = "ABC",将他们放入一个数组,但 1 个 customer 和 name = "XYZ"(只有一个具有此名称的记录)不要得到这个。
这就是我的想法
var query = (from c in entities.tblCustomers
group c.CustomerName into cust
//where cust.Key.Count >=2 (how to get this)
select ABC()
{
});
【问题讨论】: