update 表A
set toponym=(select toponym from 表B where 表A.sno=表B.sno),
haozuo=(select haozuo from 表B where 表A.sno=表B.sno)
where exists(select 1 from 表B where 表A.sno=表B.sno);
set toponym=(select toponym from 表B where 表A.sno=表B.sno),
haozuo=(select haozuo from 表B where 表A.sno=表B.sno)
where exists(select 1 from 表B where 表A.sno=表B.sno);
解决方案 »
- 简单的oracle存储过程居然一把红X
- 求教一个多条件排序查询的SQL语句
- 关于synchronous disk影响SQLxiaolv
- 在oracle数据库中如何查询出一个表中最后插入的一条记录?
- Oracle中的游标怎么用?这里怎么报错了????
- 更改主机名出现的问题?
- 为什么嵌套查询结果update时,会抱错! :(
- 请问在P4的电脑装ORACLE需要把那个文件删掉??
- Oracle中写存储过程时,关于字符串的问题
- ORACLE9I里的FUNCTION文档在ORACLE文档的哪部分啊我找了好半天也没有
- 紧急求助:帮我看看一个SQL存储过程,错在什么地方?
- 数据库开发人员和数据库管理人员有什么区别,他们具体都做些什么(见笑了!!)
set (toponym,haozuo)=(select toponym,hoazyi from 表B where 表A.sno=表B.sno),
where exists(select 1 from 表B where 表A.sno=表B.sno);
set A.TOPONYM=(select Max(B.TOPONYM) from 表B where B.SNO=A.SNO),
A.HAOZUO=(select Max(B.HAOZUO) from 表B where B.SNO=A.SNO)
where exists(select 1 from 表B where A.sno=B.sno);
update 表A
set toponym=(select toponym from 表B where 表A.sno=表B.sno),
haozuo=(select haozuo from 表B where 表A.sno=表B.sno)
where exists(select 1 from 表B where 表A.sno=表B.sno);
改成了:
update 表A
set toponym=(select toponym from 表B where 表A.sno=表B.sno),
haozuo=(select haozuo from 表B where 表A.sno=表B.sno)
---------------where exists(select 1 from 表B where 表A.sno=表B.sno)
WHERE a.sno in (select b.sno where a.sno=b.sno);
提示"编译成功",但执行起来奇慢无比!五条记录现在已执行了近四分钟了还没完,用EXISTS几秒就搞定了!请问这是怎么回事?