var q = from o in db.Orders from p in db.Products join d in db.OrderDetails on new{ o.OrderID,p.ProductID} equals new{ d.OrderID, d.ProductID } into details from d in details select new { o.OrderID, p.ProductID, d.UnitPrice };为什么要再次 from d in details ???
2 回答
三国纷争
TA贡献1804条经验 获得超7个赞
你这个应该是连表查询吧
var q = from o in db.orders
from p in db.products
join d in db.details on o.orderid equals d.orderid&&p.productid equals d.productid
select new{
orderID=o.orderid,
productID=p.productID,
UnitPrice=d.unitprice
}
- 2 回答
- 0 关注
- 683 浏览
添加回答
举报
0/150
提交
取消