欢迎投稿

今日深度:

sql语句查询之一个学生在某一年的所有成绩与查

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


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

\

www.htsjk.Com true http://www.htsjk.com/Sql_Server/24616.html NewsArticle sql语句查询之一个学生在某一年的所有成绩与查询某一个班的高等数学的成绩(代码实例),sql个班 1.查询一个学生在某一年的所有成绩 select sc_student_id as 学号,sc_student_name as 姓名, s...
评论暂时关闭