Oracle中添加视图

 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  * 即可
原文地址:https://www.cnblogs.com/tian830937/p/4424881.html