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
답변
아래 솔루션이 도움이 될 수 있습니다.
var unmanagedDownloadcountwithfilter = from count in unmanagedDownloadCount.Where(d =>d.downloaddate >= startDate && d.downloaddate <= endDate)
group count by count.unmanagedassetregistryid into grouped
where grouped.Count() > request.Download
select new
{
UnmanagedAssetRegistryID = grouped.Key,
Count = grouped.Count()
};