UPDATE B SET bf1 = '0', bf2 = '0'
FROM A,B
WHERE A.aid1 = B.bid1
AND A.aid2 = B.bid2 AND A.aid3 = B.bid3
AND B.bid1 = '0'DELETE FROM B
WHERE EXISTS
select * from A
where A.aid1 = B.bid1 AND A.aid2 = B.bid2 AND A.aid3 = B.bid3
and B.bid1 = '0'还有问题吗
FROM A,B
WHERE A.aid1 = B.bid1
AND A.aid2 = B.bid2 AND A.aid3 = B.bid3
AND B.bid1 = '0'DELETE FROM B
WHERE EXISTS
select * from A
where A.aid1 = B.bid1 AND A.aid2 = B.bid2 AND A.aid3 = B.bid3
and B.bid1 = '0'还有问题吗
解决方案 »
- Oracle 天内按小时分组查询问题
- oracle基础问题
- 急求oracle 9i 客户端,要求具有导入导出dmp 文件功能的存在
- 为什么在Oracle8i和10G的sqlnet.ora文件中加入屏蔽指定IP的语句无效?
- Oracle9ias如何配置Servlets才能使其带的Apache支持JSP
- 安装Oracle 9i出错
- [急,疑惑]有数据读不出来!
- 一个java程序传一个insert语句出错,怎么能在日志文件查看到出错信息?急
- Oracle中Char类型作为连接字段的问题
- oracle拒绝远程sysdba身份登录问题
- 惨了:救命
- 我用DELPHI作为前端,写了两种SQL语句,要送到ORACLE服务器执行,哪一种运行得更快一些呢?语句如下...
WHERE
(select count(*) from A
where A.aid1 = B.bid1 AND A.aid2 = B.bid2 AND A.aid3 = B.bid3
and B.bid1 = '0') > 0
也可以
WHERE
(select count(*) from A
where A.aid1 = B.bid1 AND A.aid2 = B.bid2 AND A.aid3 = B.bid3
and B.bid1 = '0') > 0
也可以
zhiwen_huang(黄志文):你的写法中UPDATE到好理解,DELETE的写法总觉得怪怪的。
where B.bid1 = '0'
and exists (select 'x' from a
where A.aid1 = B.bid1
AND A.aid2 = B.bid2
AND A.aid3 = B.bid3);delete from B
where B.bid1 = '0'
and exists (select 'x' from a
where A.aid1 = B.bid1
AND A.aid2 = B.bid2
AND A.aid3 = B.bid3);
where B.bid1 = '0'
and exists (select 'x' from a
where A.aid1 = B.bid1
AND A.aid2 = B.bid2
AND A.aid3 = B.bid3);delete from B
where B.bid1 = '0'
and exists (select 'x' from a
where A.aid1 = B.bid1
AND A.aid2 = B.bid2
AND A.aid3 = B.bid3);
where B.bid1 = '0'
and (bid1,bid2,bid3) in (select aid1,aid2,aid3 from a);
但是执行效率应该是exists比较高。update ... from ...是非法的