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')
相关文档:
在sql语句中涉及到时间类型时 若只想要日期 to_date('2007-7-8','yyyy-mm-dd')
在C#中有datetime类型,代码说明一切
DateTime dt = System.DateTime.Now;
string lsh;
lsh=string.Format("{0:yyyyMMddHHmmss}", dt);
DateTime dt = DateTime.Now;
Label1.Text = dt.To ......
关键词:with read only
作用:用于指定所创建的试图不可以通过本视图更新表
执行一下SQL,创建表T,和两个试图V1,V2:
CREATE TABLE T(ID INTEGER);
CREATE VIEW V1 AS SELECT * from T;
CREATE VIEW V2 AS SELECT * from T WITH READ ONLY;
执行SQL:
INSERT INTO V1 VALUES(1);
--------------------
1 row cre ......
课程概要
课程编号
:XY-DB-V01
培养目标
:具备实际操作能力的 Oracle 数据库管理员
专注Oracle实战能力的强化,完全覆盖OCP课程内容,具有更大的学习强度和更长的学习时间。
入学条件
:对Oracle或其它关系数据库有一定的基础者
班别及授课时间
:脱产班历时1个月,1 ......
Oracle 10.1 Statistics:
In Oracle 9.2 there were 264 statistics; in Oracle 10.1 there are 332 statistics
The following table shows the 106 statistics that were added in Oracle 10.1:
Name
application wait time
cluster wait time
concurrency wait time
consistent gets direct
consistent ......
对于我们刚入门的oracle初学者来说,学习sql语言是入门的第一步,面对单引号和双引号,我们可能会困惑,什么时候用单引号,什么时候用双引号呢?
单引号------ 值为字符和日期的时候 如 'you' '06-june' 还有使用连接符||,插入空格||' ......