求救,如何用sql语句进行数据检索,并对某一字段求和,输出!!! declare @sum moneyselect @sum = sum(tot) from yourtable where edate >= '2003-01-01' 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Select Sum(Field1) as Field from table1 where 条件 Select a,b,c,Sum(d) as d from tablename where 条件 group by a,b,c select sum(isnull(字段,0)) as total from table where [date] betweenbegindate and enddate order by [date] Select Sum(Field1) as Field123 from 表 where 条件 select sum(字段) as kk from 表 where 条件 table hao money101 20101 10101 10102 10102 5103 8103 16这样的查询结果hao total_money101 40102 15103 24select hao,sum(money) as total_money from yourtable group by hao select sum(field1) from table1 group by field2 一个WEB页面同时连接多个数据库性能问题 两表合并显示的问题,不知能不能实现!!! if exists 和 if not exists的问题 第一次在这提问,别让我伤心,呵呵。。。。 蛮简单的表连接,我怎么就弄不出来,气死了 SQLServer2000端口打不开 100分求过程错误的处理 谁有 SQL server2000的 英文版?SOS提供地址者 感谢。 SQL SERVER 数组 在线求救!!!! 如何登陆远程SQL数据库 sql查询问题
begindate and enddate order by [date]
101 20
101 10
101 10
102 10
102 5
103 8
103 16
这样的查询结果
hao total_money
101 40
102 15
103 24
select hao,sum(money) as total_money from yourtable group by hao