我有以下情形: 1)用戶表: int Id (PK, Identity)
// more users table columns (firstname, etc.)
2)羣組表: int Id (PK, Identity)
// more usergroups table columns (title etc.)
3)UserGroupMembership表: int Id
int
我需要的follwing查詢轉換成LINQ或拉姆達表達 SELECT count(Hid.HouseholdID) FROM
(SELECT HouseholdID FROM tblTmpJoinAll
WHERE loyal = 1 Group By HouseholdId
HAVING Count(distinct BasketID)>1) as Hid;
到目前爲止,我已經試過 l