a表id,name,age
b表id ,name,age
字段都一样现在要一条语句更新a的id,name两个字段使得a表前十行的数据跟b的前世行的数据一样只更新id,name两字段
b表id ,name,age
字段都一样现在要一条语句更新a的id,name两个字段使得a表前十行的数据跟b的前世行的数据一样只更新id,name两字段
解决方案 »
- oracle的安装问题
- 本人新建一数据库服务群:2681621
- 想恢复数据啊!
- oracle 10g 无法登录的问题,高手请进来看看啊!!
- linux 9.0下oracle 9i的安装?在线等急用
- ORACLE 初学者,请推荐几本好书和好的建议
- Oracle Client 怎样通过SqlPlus 连接到Server.在client的net manager里测试通过
- 在 ORACLE817 下 发现OracleOraHome81ManagementServer 服务已启动,是否意味已创建管理服务器?但我却找不到资料档案库所属数据库的S
- 如何实现两个表之间的___级联更新
- 求大神指教,自己被绕晕了,关于sqlServer转oracle的
- Oracle10g安装问题!
- oracle 存储过程
set (a.id,a.name)=
(
select b.id,b.name
from b
where a.rownum=b.rownum
and b.rownum<=10
)
where a.rownum<=10
提示ORA-01747: user.table.column, table.column 或列说明无效
Set (Id, Name) = ( Select Id, Name From (Select t.Idrow, T1.Id, T1.Name
From (Select Rowid As Idrow, Rownum As Num, Id, Name
From a
Where Rownum < 11) t,
(Select Rownum As Num, Id, Name From b Where Rownum < 11) T1
Where t.Num = T1.Num)
Where idrow = t2.Rowid);
Set (Id, Name) = ( Select Id, Name From (Select t.Idrow, T1.Id, T1.Name
From (Select Rowid As Idrow, Rownum As Num, Id, Name
From a
Where Rownum < 11) t,
(Select Rownum As Num, Id, Name From b Where Rownum < 11) T1
Where t.Num = T1.Num)
Where idrow = t2.Rowid);
create table a as select * from dba_objects;
create table b as select * from dba_objects;update a
set (object_id, object_name) =
(
select xb.object_id, xb.object_name
from
(
select rowid rid, rownum rn
from a
) xa
,
(
select object_id, object_name, rownum rn
from b
where rownum <= 10
) xb
where xa.rn = xb.rn
and xa.rid = a.rowid
)
where rownum <= 10;
set (object_id, object_name) =
(
select xb.object_id, xb.object_name
from
(
select rowid rid, rownum rn
from a
where rownum <= 10
) xa
,
(
select object_id, object_name, rownum rn
from b
where rownum <= 10
) xb
where xa.rn = xb.rn
and xa.rid = a.rowid
)
where rownum <= 10;
update a
set (id, name) = (select id, name
from (select rd, id, name
from (select a.rowid rd, rownum rn
from a
where rownum < = 10) m,
(select id, name, rownum rn
from b
where rownum <= 10) n
where m.rn = n.rn) t
where a.rowid = t.rd)