易截截图软件、单文件、免安装、纯绿色、仅160KB

Oracle更新多行

更新多行的步骤:
步骤多,但效率比较高:
1、create table 临时表 value (select a.id,a.name,b.name,... from table1 a,table2 b where a.id=b.id)
2、删除table1中的记录,不要drop
3、insert into table1 select 你需要的字段 from 临时表。
select * from tb_ai03
create table tb_ai031 as select * from tb_ai03
delete  from tb_ai03 a where a.yymm in ('200911','200910')
insert into tb_ai03
select a.model,a.yysal/b.unitestrip as yysal ,a.mmsal/b.unitestrip as mmsal,
a.yychu/b.unitestrip as yychu,a.mmchu/b.unitestrip as mmchu,a.yymm
from tb_ld04 b,tb_ai031 a
where a.model=b.model(+) and a.yymm in ('200911','200910')


相关文档:

oracle 表空间操作

oracle表空间操作详解
  1
  2
  3作者:   来源:    更新日期:2006-01-04 
  5
  6 
  7建立表空间
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

oracle优化器

What circumstances we use ALL_ROWS and what circumstances we use FIRST_ROWS optimizer mode? This article is written in oracle9i.
First_rows attempts to optimize the query to get the very first row back to the client as fast as possible. This is good for an interactive client server environment wher ......

Oracle 日志文件错误的处理。

转自:http://hi.baidu.com/dashuaiwang/blog/item/47cc680ec35055c37acbe1f8.html
打开oracle 数据库时出现了错误:
ORA-00313: 无法打开日志组 1 (线程 1) 的成员
ORA-00312: 联机日志 1 线程 1: 'D:\ORACLE\ORADATA\GOCOM\REDO01.LOG'
SQL> connect / as sysdba;
已连接。
SQL> shutdown immediate;
ORA- ......

ORACLE分析函数的用法

开窗函数的的理解:
开窗函数指定了分析函数工作的数据窗口大小,这个数据窗口大小可能会随着行的变化而变化,举例如下:
over(order   by   salary) 按照salary排序进行累计,order   by是个默认的开窗函数
over(partition   by   deptno)按照部门分区
ove ......

oracle中重命名列名和表名

我们在创建表结构的过程中,可能会由于失误,造成表中列名错误,如何更改呢,你可能会回答,使用OEM或者PL/SQL,除了这两种方法,我们可以使用命令:
   ALTER TABLE 表名 rename   column  列名 to 新列名     注意column是关键字   /*重命名列名*/
  ALTE ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号