有表A,字段PK是自增,money字段是存储交易金额,name是存储交易员的名字,
用一条 SQL server 语句求出每一个交易员的交易总额。
交易员的名字是惟一的话:
select sum[money] TotalMoney,[name] from A group by [Name] order by sum[Money] desc;
select sum[money] TotalMoney,[name] from A group by [Name] order by sum[Money] desc;