求一查询语句,谢谢。 表a,有字段email、num,现在要求:查到供货量(num)超过5000的所有人(email)的供货总量?请问一下,能否用一条sql语句就返回结果??不知道大家明白我的意思没有? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select email,sum(num) from 表A group by email having sum(num)!<5000 select 供货总量=(select sum(num) from a where email=c.email) from a c where c.num >5000 select sum(num) rom a where email in(select email from a as bb where bb.num > 5000) select email、sum(num) 供货总量 from 表agroup by emailhaving sum(num) > 5000 select emial,sum(num) from a group by email having num>5000 select emial,sum(num) from table1 group by email having sum(num)>5000 select sum(num) from a where email (select email from table1 group by email having sum(num)>5000) select sum(num) from a where email= (select email from table1 group by email having sum(num)>5000)少了个=号 to no1francis() :得不出结果哦,sql错误 表a,有字段email、num,现在要求:查到供货量(num)超过5000的所有人(email)的供货总量?select sum(num) from a where num>5000 to cefriend(青草):是你想的太简单了,供货量大于5000是某个人的总供货量大于5000,不是单独的一个记录:) select email, sum(num) from t group by email having sum(num)>5000 select email,count(1) from where num>5000 group by email select email,sum(num) from where num>5000 group by email你那句话~~意思太多啦! to cefriend(青草) :你写的语句上面不是早就有了吗?:( select email, sum(num) num into #1 from t group by email having sum(num)>5000select sum(num) from #1 添加excel表到sql server的问题 关于触发器的问题 两条数据间的时间 安装数据库提示1605号错误,求解答 在将 nvarchar 值 '0_50' 转换成数据类型 int 时失败 集体更新....SQL 怎么写 事情急,请大家帮忙回答一下下面的问题 SQL语句请教 关于like的意义??谢谢了! 小弟问一个很菜的问题,我如何能够通过sql的日志文件会滚数据库的内容,谢谢各位大侠!!! Win2003下安装SQL Server2000的问题 求一个sql语句
from 表a
group by email
having sum(num) > 5000
少了个=号
得不出结果哦,sql错误
查到供货量(num)超过5000的所有人(email)的供货总量?select sum(num) from a where num>5000
是你想的太简单了,供货量大于5000是某个人的总供货量大于5000,不是单独的一个记录
:)
你那句话~~意思太多啦!
你写的语句上面不是早就有了吗?:(