2009-01-28

Group By and Order By And Left Join

使用Northwind內的Table Orders


Dim db As New NorthwndDataClassesDataContext()
Dim query = From p In db.Orders() _
Group By p.CustomerID _
Into Total = Count(p.OrderID), avg = Average(p.OrderID) _
Order By CustomerID _
Select New NorthwndDLL.ddlCustomerID With {.CustomerID = CustomerID, _
.Total = Total, _
.avg = avg}

0 comments: