CREATE or REPLACE view view_will as select college.collegeid,mat.stuid,sum(score.chinese+score.math+score.english+score.complex)from college,mat,scorewhere college.collegeid=mat.first_will and mat.stuid=score.stuidgroup by SCORE.STUID,COLLEGE.COLLEGEID,MAT.STUID having sum(score.chinese+score.math+score.english+score.complex)>500
将红色字体改为查询的SQL即可
在查询的时候直接查询视图中的select * 即可
时间: 2024-11-02 19:29:54