频道栏目
首页 > 资讯 > SQL Server > 正文

sql语句查询之一个学生在某一年的所有成绩与查询某一个班的高等数学的成绩(代码实例)

18-07-17        来源:[db:作者]  
收藏   我要投稿

1.查询一个学生在某一年的所有成绩

select sc_student_id as 学号,sc_student_name as 姓名,

sc_course_name as 课程,sc_score as 分数

from t_score

where sc_student_id = 学生学号

and sc_edu_year = 201x-201x;

查询实例1

2.查询某一个班的高等数学的成绩

select cl.班级,cl.学生姓名,sc.sc_course_name as 科目,sc.sc_score as 成绩

from

(select st.st_class as 班级,st.st_name as 学生姓名,

from t_student as st

where st.st_class = 班级名) cl

left join t_score as sc

on cl.学生姓名 = sc.sc_student_name

where sc_course_name = "高等数学"

order by 成绩

查询实例2

相关TAG标签
上一篇:Twistedadbapi使用mysql时提示报错及解决方案分享
下一篇:poj3635 Full Tank(dp+bfs/dij)
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站