Oracle中添加视图

时间:2015-04-14 16:09:33   收藏:0   阅读:216
 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  * 即可

原文:http://www.cnblogs.com/tian830937/p/4424881.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!