您的位置:首页 > 其它

实验16-14 请在testdb中:查找每个客户(包括没有订单的客户)的客户

2018-07-19 18:37 609 查看

testdb是产品销售数据库,请在testdb中:查找每个客户(包括没有订单的客户)的客户编号、名称、订单日期、订货金额,其中订单日期格式为yyyy-mm-dd,按客户编号排序,同一客户再按订单金额降序排序输出。

select  customer.cust_id,cust_name,CONVERT(varchar(10),order_date,121)as order_date,tot_amt
from  customer left outer join  sales
on (customer.cust_id=sales.cust_id)
order by customer.cust_id asc,sales.tot_amt

  

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐