【简答题】统计每位客户订购的每种图书的总数量及平均单价 并按客户名 图书号从小到大排列。

大学网课 已帮助 人

【简答题】统计每位客户订购的每种图书的总数量及平均单价,并按客户名,图书号从小到大排列。

【简答题】统计每位客户订购的每种图书的总数量及平均单价 并按客户名 图书号从小到大排列。

热搜:简答题简述政府外债的主要功能

回答

共1条回复

  • select customer.cust_name,sale_item.book_no ,sum(qty) 总数量,sum(qty*unit_price)/sum(qty) 平均单价 from sales,customer,sale_item where sales.cust_name=customer.cust_name and sale_item.order_no=sales.order_no group by customer.cust_name,sale_item.book_no order by customer.cust_name,sale_item.book_no