首页 > 其他 > 详细

视图--bai

时间:2017-01-08 16:19:45      阅读:193      评论:0      收藏:0      [点我收藏+]
/*视图的必要性
create view population_all_view
as
 select xxxx 详细信息 from qgck  where rownum<500 -- sql语句不易读懂

create view population_all_view
as
select * from qgck where rownum<500;-- sql语句超出负载。

*/

select * from scott.emp;


--视图的创建
   查询员工编号、员工名及所在部门的名称
   create or replace  view  emp_basic_info_view 
   as
  select  scott.emp.empno as 员工编号,scott.emp.ename as 员工名,
  scott.dept.dname as 部门名  from scott.emp ,scott.dept 
  where scott.emp.deptno = scott.dept.deptno
  
  --查询视图
  select * from emp_basic_info_view
  
delete from system.emp_basic_info_view where 员工编号=‘8000‘;


--练习1

  

视图--bai

原文:http://www.cnblogs.com/ipetergo/p/6262033.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!