我有两个结果表,一个中期结果表和年度结果表。
中期成绩表:
年度结果表:
我想加入他们并找到每个学生每个科目的总分
求中期和期末成绩总分后的通缉成绩表
到目前为止我的代码:
mysql_query("drop view if exists result_view");
mysql_query("create view result_view as
select * from mid_term
UNION ALL
select * from annual") or die(mysql_error());
//now find the total marks of students for each subject
mysql_query("select id,student_id,subject_id,result_id,year,sum(mark) as mark
from result_view ");
但这行不通,请提供任何帮助或建议!!!!!!1