oracle 的更新语句(100)

  • 主题发起人 主题发起人 aahben
  • 开始时间 开始时间
A

aahben

Unregistered / Unconfirmed
GUEST, unregistred user!
大家看看如下的语句该怎么写,我是新手,对ORACLE不太熟,请帮忙看一下,如下语句不能执行,帮我修改一下,我以前是用先select ,再一条条的更新,但是数据太大,速度就慢了,我想要一次性更新语句,谢谢大家update a set a.theinvoicefee=b.sumfee from tb_businessbillpay a,(select invoiceno,sum(theinvoicefee) sumfee from tb_businessbillpay where billno is not null group by invoiceno) b where a.billno is null and a.invoiceno=b.invoiceno
 
update tb_businessbillpay aset theinvoicefee = (select invoiceno,sum(theinvoicefee) sumfee from tb_businessbillpay where billno is not null and a.invoiceno=b.invoiceno group by invoiceno ) b where a.billno is null
 
to dgtg0710,报语句未结束的犯错误!不行.
 
update tb_businessbillpay a set a.theinvoicefee =(select sum(theinvoicefee) from tb_businessbillpay where billno is not null and a.invoiceno = b.invoiceno group by invoiceno) where a.billno is null
 
你可以试一下这个:update tb_businessbillpay aset theinvoicefee = (select sum(b.theinvoicefee) sumfee from tb_businessbillpay b where b.billno is not null and a.invoiceno=b.invoiceno group by b.invoiceno ) where a.billno is null theinvoicefee = 后面的值要唯一才行,否则不知道等于哪个值
 
不好意思,居然没有注意到上次散分没有成功,现在再散分。谢谢
 
后退
顶部