一条修改语句的写法 update (select a.id,a.quantity as quantitya,b.quantity as quantityb from a,bwhere a.id=b.id) set quantitya=quantitya-quantityb 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 参考下例:改成你要的就行了.UPDATE aa_a t SET t.price=(SELECT a.price-b.price FROM aa_a a,aa_b b WHERE a.col_a=b.col_a AND a.col_a=t.col_a) update a set quantity=(select quantity from b where a.id=b.id) where exists(select 1 from b where a.id=b.id) update A t set t.QUANTITY=(SELECT a.QUANTITY-b.QUANTITY FROM A a,B b WHERE a.id=b.id AND a.id=t.id) update a set quantity=(select a.quantity-quantity from b where a.id=b.id) where exists(select 1 from b where a.id=b.id)上面写错了 SQL> select * from a; ID QUANTITY----------- ----------- 1 10 2 10 3 10 4 10 5 10 6 10 7 107 rows selectedSQL> select * from b; ID QUANTITY----------- ----------- 1 10 3 10 5 10 7 10SQL> update a set quantity=(select a.quantity-quantity from b where a.id=b.id) 2 where exists(select 1 from b where a.id=b.id);4 rows updatedSQL> select * from a; ID QUANTITY----------- ----------- 1 0 2 10 3 0 4 10 5 0 6 10 7 07 rows selected Dbvisualizer启动报错 oracle 中占用大量cpu的进程都是i/o slave wait 关于数据库锁表的问题 10g审计,为什么不审计sys用户 [续]开发一个oracle存储过程,望高手给些思路,不胜感激! WIN7 64位 安装ORCLE11G 求帮助啊!!! 求助如何查看oracle当前或系统用户下共有多少个数据库存 ? SQL语句!请高手回答 初来贵地,散分认识朋友. 求推荐oralce放面的书籍。 视图问题!!! 关于oracle定时任务的问题
UPDATE aa_a t SET t.price=(SELECT a.price-b.price FROM aa_a a,aa_b b WHERE a.col_a=b.col_a AND a.col_a=t.col_a)
----------- -----------
1 10
2 10
3 10
4 10
5 10
6 10
7 107 rows selectedSQL> select * from b; ID QUANTITY
----------- -----------
1 10
3 10
5 10
7 10
SQL> update a set quantity=(select a.quantity-quantity from b where a.id=b.id)
2 where exists(select 1 from b where a.id=b.id);4 rows updated
SQL> select * from a; ID QUANTITY
----------- -----------
1 0
2 10
3 0
4 10
5 0
6 10
7 07 rows selected