码迷,mamicode.com
首页 > 其他好文 > 详细

视图--bai

时间:2017-01-08 16:21:25      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:cot   sha   员工   blog   ott   ace   class   arp   replace   

/*视图的必要性
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

标签:cot   sha   员工   blog   ott   ace   class   arp   replace   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!