sql

select ob.Quantity,ob.UnitPrice ,r.TotalPrice
from dbo.OrderBook ob
inner join (select OrderId , sum(TotalPrice ) TotalPrice from dbo.Orders group by OrderId ) r on ob.OrderID =r.OrderId

posted @ 2014-05-26 23:21  小菜鸟飞飞  阅读(112)  评论(0编辑  收藏  举报