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;
猜你喜欢
- 调用很简单 Readkid.motion.tween(target,duration, vars)target: 要缓动的DOM对象dura
- 什么是合并多行字符串(连接字符串)呢,例如: SQL> desc test; Name Type Nullable Default C
- 前面我们讲了一些Dreamweaver MX的基本操作,相信大家看了后都会觉得比较简单,的确,这是个工具软件,操作方便应该是它的宗旨。其实网
- 在附加数据库后查看不了数据库关系图,也无法建立数据库关系图 我的解决方法如下: 1、设置兼容级别为90(2005为90)(2000为80)
- 现在,比较牛的设计师和开发者都认识到了可用性在他们工作中的重要性。可用性好的网站会极大地提高用户体验,并且好的用户体验会让用户更加快乐。用聪
- Filed under 数据库技术Leave a commentSQL Server命令行导数据两种方式bcp和sqlcmd先说一下bcp:
- Access method(访问方法):此步骤包括从文件中存储和检索记录。Alias(别名):某属性的另一个名字。在SQL中,可以用别名替换
- [参与测试的浏览器:IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ][操作系统:Windows
- 学习使用存储过程(Stored Procedure),是ASP程序员的必须课之一。所有的大型数据库都支持存储过程,比如Oracle
- 早就想用一个系列的文章来写AJAX,让自己头到尾理一遍,更好的掌握基础知识(昨天的面试受打击了,基础知识很重要).要是写的好,也许也可以帮助
- CSS是制作网页效果必不可少的东西,字体的颜色定义、表格的样式定义、图片的特效等等都少不了它。但在Dr
- 在使用Dreamweaver制作主页的时候往往需要改变表格的高度。然而有时当我们拖动表格的边框,无论怎样拖动,等到放下鼠标,表格却又恢复到原
- 原文地址:30 Days of Mootools 1.2 Tutorials - Day 15 - SlidersMooTools 1.2的
- CSS圆角的现实一直是大家所热衷的话题,我们进行CSS布局一直强调语义,强调文档的结构。圆角作为页面的外面表现,应该分离到CSS文件中,可以
- 本文描述通过统计分析出医院信息系统需分区的表,对需分区的表选择分区键,即找出包括在你的分区键中的列(表的属性),对大型数据的管理比较有意义,
- 原文地址:30 Days of Mootools 1.2 Tutorials - Day 2 - Selectors如果你还没有准备好,请先
- 原理:自定义javascript中的oncontextmenu事件,然后使用div层模拟菜单。知道了这个原理结合美工相信你可以做出很漂亮的自
- 这个问题对于规模稍微大些的项目而言,显得尤其重要了,数据库中如果有几百个存储过程, 难道还一个个找不成,即使自己很了解业务和系统,时间长了,
- 最近越来越多在博客上写些UX相关的内容作为分享,就涉及到跟普通博文不一样的文章建构问题。文章内容固然很重要,但排版、组织也是提高可读性和用户
- 这篇论坛文章(赛迪网技术社区)主要介绍了数据仓库基本报表制作过程中的SQL写法,详细内容请参考下文:在数据仓库的基本报表制作过程中,通常会使