oracle第二天

1.oracle数据库如何创建一个新用户create user lvmin identifid by123456
grant connect,resource to lvmin
Grant select on scott.emp tolvmin with grant option
2、取消权限 revoke
3、内连接 join ...on
左外连接 left join on,是以左表为主表,来获取内连接和不满足左表数据的内容,右连接反之亦然。

全外连接,mysql不支持,但oracle支持
from子查询
将一个查询结果作为另一个查询条件的内容。如
select avg(sal) from (
select * from emp where deptno=30
)

-- 分页查询,再次查询一次是为了让这个伪列变成真正的条件
   select * from (
   select rownum as num,emp. * from emp )where num>=1 and num<=5
   --公式
   -->(当前页-1)*条数+1 <=当前页*条数
  

--连接操作符
   select '工号为'||empno||'姓名'||ename||'工资为'||sal  as str from  emp

   --字符函数
   select initcap('nihao') from dual
   select lower(ename),sal,comm from emp
   select ltrim('xayzdm','xyz') from dual

union操作符返回两个结果的不重复
intersect返回两个查询公共部分
minus操作符满足第一个结果,并排除第二个不满足条件的结果

原文地址:https://www.cnblogs.com/a199706/p/11686373.html