update ... col1=(select ... from a,b where ...) where exist (select 1 from a,b where ....)
你的语句是有问题的,你看where后面怎么还有from,where? update RECVLIST SET CheckStatus='1' where BossSN in ( select BossSN from TRANSFER ) and RECVFEE=TRANSFER.TransferAmount from RECVLIST,TRANSFER ~~~~~~~~~~~~~~~~~~~~~~~~~~ where RECVLIST.BossSN=TRANSFER.BossSN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update RECVLIST a set CheckStatus='1' where a.BossSN in( select b.BossSN from a,TRSNSFER b where a.BossSN=b.BossSN and a.RECVFEE=b.TransferAmount);
初学 ORACLE 有很多地方不明白,请教个问题: TableA 表的字段: Num Number(5),Name VarChar(20)TableB 表的字段: Num Number(5),Name VarChar(20),IsOld Number(1) Default 0用 SQL 2000 的描述方法是: Update B set B.Name = A.Name,B.IsOld = 0 from TableA A,TableB B where A.Num = B.Num and B.IsOld = 1; 在 ORACLE 中怎实现?
...
col1=(select ... from a,b where ...)
where exist (select 1 from a,b where ....)
update RECVLIST
SET CheckStatus='1'
where
BossSN in (
select BossSN
from TRANSFER
)
and RECVFEE=TRANSFER.TransferAmount
from RECVLIST,TRANSFER
~~~~~~~~~~~~~~~~~~~~~~~~~~
where RECVLIST.BossSN=TRANSFER.BossSN
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
where a.BossSN in(
select b.BossSN from a,TRSNSFER b
where a.BossSN=b.BossSN
and a.RECVFEE=b.TransferAmount);
TableA 表的字段: Num Number(5),Name VarChar(20)TableB 表的字段: Num Number(5),Name VarChar(20),IsOld Number(1) Default 0用 SQL 2000 的描述方法是:
Update B
set B.Name = A.Name,B.IsOld = 0
from TableA A,TableB B
where A.Num = B.Num and B.IsOld = 1;
在 ORACLE 中怎实现?