Oracle学习笔记(五)

所属分类: 数据库 / oracle 阅读数: 101
收藏 0 赞 0 分享
组合集总计:
group by with rollup/cube
grouping sets
子查询按执行方式分:标准子查询、关联子查询
标准子查询:嵌套子查询
标量值查询
case with then
使用exits查询
select user_id,user_name from tb_001 tb
where [not] exists (select 'x'
from tb_001
where manager_id=tb.user_id )
关联更新
update table1 alias1
set column=(select expression
from table2 alias2
where alias1.column=alias2.column);
关联删除
delete from table1 alias11
where column operator
(select expression
from table2 alias2
where alias1.column=alias2.column);
分层结构
分层检索
select [level],column,expr...
from table
[where with condition(s)]
[connect by prior condition(s)]
connect by prior column1=column2
top down:
colum1=parentkey
column2=childkey
bottom up:
column1=childkey
column2=parentkey

插入语句insert statement
insert into table[(column[,column...])]
values(value[,value...])
修改语句update statement
update table
set column=value[,column=value,...]
[where condition];

多表插入语句(Multitable Insert Statements)

insert [all] [conditional_insert_clause]
[insert_into_cause values_clause](subquery)
conditional_insert_clause
[all][first]
[when condition then][insert_into_clause values_clause]
[else][insert_into+clause values_clause]
列:
intsert all
into tb_user values(id,uid,upwd)
into tb_user_info values(id,name,sex,age)
select id,uid,upwd,name,sex,age
from tb_u_10
where id>10000;
待条件的多行插入
insert all
when id>11000 then
into tb_user values(id,uid,upwd)
when age>40 then
into tb_user_info values(id,name,sex,age)
select id,uid,upwd,name,sex,age
from tb_u_10
where id>10000;
insert first
when conditional then
into ...
when conditional then
into ...
else
into...
select...
创建索引
cretate table t_10
(id number(6) not null primary key using index (create index index1 on t_10(id)),
name varchar2(50));
查询索引
select * from user_indexes;
更多精彩内容其他人还在看

Oracle固定执行计划之SQL PROFILE概要文件详解

概要文件,就是一份描述如何使用系统的资源(主要是CPU资源)的配置文件,这篇文章主要介绍了Oracle固定执行计划之SQL PROFILE概要文件 ,需要的朋友可以参考下
收藏 0 赞 0 分享

Oracle 12CR2查询转换教程之表扩展详解

Oracle 12cR2版本已经发布有一段时间,下面这篇文章主要给大家介绍了关于Oracle 12CR2查询转换教程之表扩展的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考借鉴,下面随着小编来一起学习学习吧
收藏 0 赞 0 分享

Oracle 12CR2查询转换教程之cursor-duration临时表详解

这篇文章主要给大家介绍了关于Oracle 12CR2查询转换教程之cursor-duration临时表的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
收藏 0 赞 0 分享

Oracle 12CR2查询转换教程之临时表转换详解

这篇文章主要给大家介绍了关于Oracle 12CR2查询转换教程之临时表转换的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
收藏 0 赞 0 分享

Oracle中字符串截取常用方法总结【推荐】

这篇文章主要介绍了Oracle中字符串截取常用方法总结,非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下
收藏 0 赞 0 分享

关于expdp任务异常的处理案例详析

这篇文章主要给大家介绍了关于expdp任务异常处理的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
收藏 0 赞 0 分享

oracle中的一些常用函数及示例

这篇文章主要给大家介绍了关于oracle中的一些常用函数及示例的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
收藏 0 赞 0 分享

oracle实现一对多数据分页查询筛选示例代码

这篇文章主要给大家介绍了关于oracle实现一对多数据分页查询筛选的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
收藏 0 赞 0 分享

Oracle数据库新装之后出现的监听程序无法正常启动和运行(Oracle-12514)问题

这篇文章主要介绍了Oracle数据库新装之后出现的监听程序无法正常启动和运行(Oracle-12514)问题,需要的朋友可以参考下
收藏 0 赞 0 分享

Oracle中定义以及使用同义词的方法

这篇文章主要给大家介绍了关于Oracle中定义以及使用同义词的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多