1
我有以下查詢:如何從linq查詢檢索聚合值?
from spl in SpeciesLists
join ar in Areas on spl.Station.Area equals ar.Id
join ground in Grounds on ar.Ground equals ground.Id
join re in Regions on ground.Region equals re.Id
where spl.Station.Trip.year ==2013
select new
{
SpciesCommonName = slp.Description,
Are = ar.description,
Ground = ground.Code,
NumberOfTripsInProtectedAreas = "To be calculated",
}
「行」字可以包含一個或多個站。保護區字段位於Trip表中,可以是1或0.一個站有一個或多個物種。
如何計算保護區內的行程次數?
很多感謝
你的選擇列表中包含「SLP .Description「,這意味着你的結果將包含物種列表而不是行程列表!如果你想聚合旅行,我相信你的結果應該是不同的。你能否澄清這一點? –
正確,但這是因爲我需要將所選columsn的結果分組。我知道這在psot中被省略了。 –
所以,你想要聚合值在三列? –