设为首页 加入收藏

TOP

一道经典的sql语句题
2014-11-24 01:42:03 来源: 作者: 【 】 浏览:0
Tags:一道 经典 sql 语句

给一个班级成绩表 student (name,subject,score) ,

\

\

查询出所有总分数>600分的学员

select name,sum(score) from student group by name having sum(score)>600;
在总分大于零的基础上,去掉不及格的学员并按总分倒序排列。
select name,sum(score) s from student group by name having sum(score)>600 and min(score)>60 order by s desc;
找出有三科挂了的学员
select name from student  where score<60 group by name having count(name)>=3;
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇使用SQLServerProfiler跟踪数据库 下一篇SQLServer2005及以上存储过程分页..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: