select Customers.cust_name,Orders.order_num,tb.OrderTotal 
from Customers
inner join Orders
on Customers.cust_id=Orders.cust_id inner join
(select order_num,sum(quantity*item_price) OrderTotal from OrderItems group by order_num) tb
on Orders.order_num=tb.order_num
	
                        from Customers
inner join Orders
on Customers.cust_id=Orders.cust_id inner join
(select order_num,sum(quantity*item_price) OrderTotal from OrderItems group by order_num) tb
on Orders.order_num=tb.order_num
	order by cust_name,order_num;

 京公网安备 11010502036488号
京公网安备 11010502036488号