求sql语句,急

youcailing 2003-03-21 04:08:05
表结构如下
xm money time
kkk 54 12:00
lll 76 1:00
xxx 65 8:00
kkk 34 6:00
www 43 6:00
rrr 100 5:00
求捐款总额前3名者,money为所捐的款,每个人可以捐多次
...全文
68 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
youcailing 2003-03-21
  • 打赏
  • 举报
回复
谢谢大家,非常感谢,我要加分
yoki 2003-03-21
  • 打赏
  • 举报
回复
select top 3 xm from tablename group by xm order by sum(money) desc
SophiaWang 2003-03-21
  • 打赏
  • 举报
回复
select top 3 xm,sum(money) as SumMoney
from table_name
group by xm
order by SumMoney desc
pengdali 2003-03-21
  • 打赏
  • 举报
回复
select top 3 xm,sum(money) money from 表 group by xm order by sum(money) desc
Rewiah 2003-03-21
  • 打赏
  • 举报
回复
select top 3 xm,sum(money) as money from tablename group by xm order by sum(money) desc

or:
select top 3 xm from tablename group by xm order by sum(money) desc
CrazyFor 2003-03-21
  • 打赏
  • 举报
回复
select top 3 xm,sum(money) as money from 表 group by xm order by money

34,873

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧