题解 | 确定最佳顾客的另一种方式(二)
select cust_name,sum(item_price*quantity) as total_price from OrderItems s1,Orders s2,Customers s3 where s1.order_num=s2.order_num and s2.cust_id=s3.cust_id group by cust_name having total_price>=1000 order by total_price
select cust_name,sum(item_price*quantity) as total_price from OrderItems s1,Orders s2,Customers s3 where s1.order_num=s2.order_num and s2.cust_id=s3.cust_id group by cust_name having total_price>=1000 order by total_price
相关推荐