假设订单表orders用来存储订单信息,cid代表客户编号,money代表单次订购额,现要查询每个客户的订购次数和每个客户的订购总金额,下面()sql语句可以返回正确结果。
- A、select cid,count(distinct(cid)),sum(money) from orders group by cid
- B、select cid,count(distinct(cid)),sum(money) from orders order by cid
- C、select cid,count(cid),sum(money) from orders order by cid
- D、select cid,count(cid),sum(money) from orders group by cid
正确答案:D
答案解析:有

微信扫一扫手机做题