Oracle学习笔记(五)

来源:asp之家 时间:2012-01-05 18:52:30 

组合集总计:
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,学习笔记
0
投稿

猜你喜欢

  • 教你用Python创建微信聊天机器人

    2021-10-06 21:50:14
  • go语言环境搭建简述

    2024-05-22 10:12:57
  • python如何删除文件、目录

    2022-02-03 09:28:09
  • Python实现的对本地host127.0.0.1主机进行扫描端口功能示例

    2021-05-13 08:43:23
  • vue.js 动态组件详解

    2024-04-29 13:09:58
  • python3调用百度翻译API实现实时翻译

    2021-06-21 01:45:46
  • windows上彻底删除jupyter notebook的实现

    2022-06-29 13:06:32
  • vue循环中点击选中再点击取消(单选)的实现

    2024-05-13 09:43:50
  • 详解Python对某地区二手房房价数据分析

    2022-04-07 04:47:30
  • python添加命令行参数的详细过程

    2022-03-18 15:34:27
  • python请求域名requests.(url = 地址)报错

    2021-12-18 06:28:36
  • 当设计师遇上前端开发

    2009-05-04 14:05:00
  • 一起来学习一下python的数据类型

    2023-01-03 08:33:46
  • Python实现监控内存使用情况和代码执行时间

    2023-05-02 15:42:02
  • 获取Dom元素的X/Y坐标

    2009-10-10 12:49:00
  • 滑动展开/收缩广告代码实例效果

    2007-10-09 12:44:00
  • 利用Python实现斐波那契数列的方法实例

    2022-11-07 11:20:14
  • Python文件与文件夹常见基本操作总结

    2023-08-08 16:56:09
  • python线程池threadpool实现篇

    2022-03-21 19:37:34
  • SQL Server 2005中的CLR集成

    2009-03-10 15:07:00
  • asp之家 网络编程 m.aspxhome.com