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
投稿

猜你喜欢

  • 推荐一篇不错的新手asp编程的基本法则

    2011-04-15 11:08:00
  • 关于CSS中字号控制的兼容性研究

    2010-01-23 12:48:00
  • 通用的下拉菜单__用DL\\DD\\DT解决无法遮住select的问题

    2008-07-28 13:28:00
  • 为什么不压缩 HTML

    2010-05-07 12:37:00
  • 用ASP木马实现FTP和解压缩

    2008-02-13 08:47:00
  • 也谈access数据库的防下载保护

    2007-08-28 13:01:00
  • 如何得到数据库中所有表名 表字段及字段中文描述

    2012-01-05 18:56:44
  • JavaScript 中为 Date 类实现 DateAdd 方法

    2008-04-03 16:19:00
  • 用ASP对网页进行限制性的访问

    2008-07-03 13:02:00
  • mysql 插入优化

    2010-12-14 15:29:00
  • Dreamweaver MX 2004表格设计

    2008-02-03 11:36:00
  • CSS背景图片的运用优化HTTP连接数

    2008-09-04 21:38:00
  • MySQL数据库的root口令恢复方法总结

    2009-08-19 09:03:00
  • 讲解SQL Server数据库的触发器安全隐患

    2009-01-13 14:01:00
  • 如何使用sql语句来修改数据记录

    2007-06-21 11:48:00
  • Javascript 利用 DOM 特性的两个小技巧

    2009-02-28 14:07:00
  • 数据库分页大全(mssql,mysql,oracle)

    2010-10-25 20:02:00
  • 微软建议的ASP性能优化28条守则(8)

    2005-05-30 16:04:00
  • 智能录入表格[适合BS模式项目的录入页面]

    2008-03-09 19:02:00
  • 可以在线创建文件夹吗?

    2009-11-01 18:07:00
  • asp之家 网络编程 m.aspxhome.com