您的位置:首页 > 大数据 > 人工智能

视图--bai

2017-01-08 15:06 127 查看
/*视图的必要性
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


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: