在Oracle中创建视图时,权限不够:
原因:用scott用户登录的,没有为此用户授予创建视图的权限;
解决方法:用system用户登录,Connect asSYSDBA
登录进去之后,新建SQLWindow,
输入并运行(为scott用户授予创建视图的权限,注意必须先切换到管理员用户):grant create any view to scott;
现在再来创建视图,问题解决。
create or replace view findsal
as
select ename,sal
from emp
where sal between 2000 and 5000 and ename like '%A%';
select * from findsal