update tb1
set code = b.code,
num = b.num
from tb1 (
select code, sum(num) as num from tb1 group by code
) b
where tb1.code = b.code
set code = b.code,
num = b.num
from tb1 (
select code, sum(num) as num from tb1 group by code
) b
where tb1.code = b.code
解决方案 »
- 多个逻辑处理,一个SQL能搞定吗?求助
- 求教oracle查询树形表脚本问题
- oracle xml(偶穷没分,帮帮忙啊)
- 哪位高手帮忙优化一下存储过程
- orcle中能够查询出一条记录的哪个会话或用户写入的吗?最好还能查到是哪个客户端操作的。谢谢。100相送
- 如何对Oracle数据库的一个表进行测试?
- 紧急,请问如果oracle存储过程需要返回结果集一定要把存储过程写如包吗?另外请给个简单的例子
- 这样的视图怎么建
- 请问select语句中for update of ......nowait是什么意思?
- 如何在oracle 下执行下面的语句
- 在PL/SQL中跟据查询创建会话临时表的问题?
- 关于oracle中date类型的字段
(
select b.code,sum(b.num) from b
where tb1.code=b.code
group by b.code
)
set num= (select sum(num) from tb1 where code=a.code);