B表比A表多了一个roid字段,其他的字段全部相同,现在将B表中B.id=A.id 的内容从B表中更新到A表中,只要几个列,并不是全部列的内容,然后删除B表中B.id=A.id 的记录,请问怎么做啊??
A表id name old login_time ……(字段)
1 NULL NULL 2004-3-30 ……B表id name old login_time …… roid(字段)
1 AAA 12 NULL …… 2要求A表记录为:
id name old login_time ……
1 AAA 12 2004-3-30 ……
A表id name old login_time ……(字段)
1 NULL NULL 2004-3-30 ……B表id name old login_time …… roid(字段)
1 AAA 12 NULL …… 2要求A表记录为:
id name old login_time ……
1 AAA 12 2004-3-30 ……
解决方案 »
- sysdate转换成字符串的问题
- 在Oracle中,如何将一张表中的long字段的数据插入到另一张表中的clob的字段中
- 请教截取字符串部分内容的问题!
- 急:交叉报表问题,字段为字符型
- 一个SQL语句
- 急 ,system表空间错误
- 有关ORACLE数据库的修复
- 在oracle中如何查找是哪个用户锁表?
- 使用ADO连接Oracle8.1.7数据库,provider均采用微软的MSDAORA.1 但Delphi编的程序有时能连上(概率较小)有时不能连上,VC++编的程序没
- oracle中怎么设置sessoin中执行一条命令时最多影响到的记录行数
- plsql调试存储过程(导出CSV)时报目录路径无效
- 如何获得当前年月和某年月的天数?
values(select id,name,old,login_time from B);ok!
还有办法吗??
update a set old=(select old from b where id=b.id);delete from b where exists(select 1 from a where id=b.id);
insert into A(id,name,old,login_time)
select id,name,old,login_time from B;
update a set col1=b.col1,... where id=(select id from b);
commit;
-- id是主键,否则会出错!
delete from b where id = (select id from b);
commit;我感觉,应该和rowid没有关系!