0
我已創建一個LINQ允許從tabRealisation
選擇離開加入tabRealisation
VB LINQ從兩個DataTable選擇使用留下了分組加入,並給予總
Dim query =
(From r In tabRealisation.AsEnumerable
Group Join p In tabPrevision.AsEnumerable
On r.Field(Of Integer)("code_part") Equals p.Field(Of Integer)("code_part")
Into Group
Let p = Group.FirstOrDefault
Select
nom_ville = r.Field(Of String)("nom_ville"),
Designation_part = r.Field(Of String)("Designation_part"),
NbrR = r.Field(Of Integer)("UniteVendu"),
CaR = r.Field(Of Double?)("CAVendu"),
NbrP = p.Field(Of Integer)("UniteVentePrev"),
CaP = p.Field(Of Double?)("CAVentePrev")
).ToList
但我想要的是把這個查詢得到Sum("UniteVendu")
,Sum("CAVendu")
......通過"code_part"