單項選擇題

假設訂單表orders用來存儲訂單信息,cid代表客戶編號,money代表單次訂購額,現(xiàn)要查詢每個客戶的訂購次數(shù)和每個客戶的訂購總金額,下面()sql語句可以返回正確結(jié)果。

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

微信掃碼免費搜題